Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Could not find the REVCAP32.DLL

Using SRP utilities 2.1.11 and latest NSI files from SRP and latest NSIS.

(1) Create RDK in C:\RDK
(2) Modified SRP_Template_RDK.nsi (see below, these are the only changes I made)
(3) Copy my install of OI from C:\OI32 to C:\Test
(4) Compiled nsi file
(5) Run nsi exe file.

I get an error "Could not find the REVCAP32.DLL"

Any ideas anyone?

#########################################################################################
# Product Information
#########################################################################################

; Modify the following defines to personalize the installer to you product
; For any !define labelled as optional in the comments, you may comment out or delete it

; Product Information
!define PRODUCT_NAME "Tactic" ; The name of the product being installed
!define PRODUCT_VERSION "6.0.624" ; The product's version number
!define PRODUCT_PUBLISHER "Waterloo Manufacturing Software" ; The name of your company
!define PRODUCT_WEB_SITE "http://www.waterloo-software.com/" ; The URL of your company website (optional)

; Install Information
!define INSTALLER_NAME "C:\InsTAC32\Tactic\Upgrade.exe" ; The path and name of the installer
!define SOURCE_RDK_DIRECTORY "C:\RDK" ; The directory containing the RDK you wish to install
!define DEFAULT_OI_DIR "C:\Test" ; The default OI directory to which RDK will be installed
#!define LICENSE_FILE "" ; The license file you wish to display (optional)
#!define CUSTOM_BRANDING "My Catchy Phrase" ; The text to replace the NSIS branding

; Installer Graphics
!define INSTALLER_ICON "c:\oi32\WTACTIC.ICO" ; The installer icon (optional)
#!define WIZARD_BITMAP "C:\MyImages\MyWizard.bmp" ; The bitmap used for the welcome/finish pages (optional)
#!define HEADER_BITMAP "C:\MyImages\MyHeader.bmp" ; The bitmap used for the page headers (optional)

; Application Login Page Defaults
!define DEFAULT_APP_NAME "W_TACTIC" ; The default value for the Application field
!define DEFAULT_USERNAME "W_TACTIC" ; The default value for the Username field
!define DEFAULT_PASSWORD "" ; The default value for the Password field

; If you plan to include a readme or help file, set it here
#!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\MyReadme.txt"

Comments

  • Just to check there is nothing amiss further on. This is working for me. (OI9)

    ######################################################################################### # Settings ######################################################################################### ; use LZMA compression -- it's pretty darn good SetCompressor lzma ; Vista wants to know what execution level we think we'll need RequestExecutionLevel highest ; allow users to install into root AllowRootDirInstall true ; replace the NSIS branding with ours !ifdef CUSTOM_BRANDING BrandingText "${CUSTOM_BRANDING}" !endif ; MUI2 Settings !define MUI_ABORTWARNING !ifdef INSTALLER_ICON !define MUI_ICON "${INSTALLER_ICON}" !else !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" !endif !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_RIGHT !ifdef HEADER_BITMAP !define MUI_HEADERIMAGE_BITMAP "${HEADER_BITMAP}" !else !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-r.bmp" !endif !ifdef WIZARD_BITMAP !define MUI_WELCOMEFINISHPAGE_BITMAP "${WIZARD_BITMAP}" !else !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" !endif !define MUI_CUSTOMFUNCTION_ABORT OnUserAbort ; Global variables Var OI_APP Var OI_USERNAME Var OI_PASSWORD Var CTRL_USERNAME Var CTRL_PASSWORD Var CTRL_APP ######################################################################################### # Modern User Interface Setup ######################################################################################### ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !ifdef LICENSE_FILE !insertmacro MUI_PAGE_LICENSE ${LICENSE_FILE} !endif ; Directory page (modified to verify oinsight.exe and oengine.exe exist) !define MUI_DIRECTORYPAGE_TEXT_TOP "Setup will install $(^NameDA) to the following OpenInsight application. To install to a different application, click Browse and select another OpenInsight folder. Click Next to continue." !define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave !insertmacro MUI_PAGE_DIRECTORY ; Application Login page (this is a custom page; see the ApplicationLogin functions for details). Page custom ApplicationLoginPage ApplicationLoginLeave ; Instfiles page (modified to install the RDK) !define MUI_PAGE_CUSTOMFUNCTION_PRE InstallPre !define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstallLeave !insertmacro MUI_PAGE_INSTFILES ; Finish page !insertmacro MUI_PAGE_FINISH ; Language files !insertmacro MUI_LANGUAGE "English" ######################################################################################### # Installation ######################################################################################### ; Some general install information Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "${INSTALLER_NAME}" InstallDir "${DEFAULT_OI_DIR}" ShowInstDetails show ; Package and install the RDK files Section "RDK" SetOutPath "$INSTDIR\UPGRADE" File "${SOURCE_RDK_DIRECTORY}\*.*" SectionEnd ######################################################################################### # Events ######################################################################################### ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called before the installation starts. Used to initialize the login credentials. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function .onInit ; init variables StrCpy $OI_APP "${DEFAULT_APP_NAME}" StrCpy $OI_USERNAME "${DEFAULT_USERNAME}" StrCpy $OI_PASSWORD "${DEFAULT_PASSWORD}" Functionend ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called after the user aborts. Used to shutdown OI if it's running and to remove any ; temporary RDK folders. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function OnUserAbort ; make sure we close the rdk stuff srputil::shutdownOI ; remove the temporary rdk install folder RMDir /r $INSTDIR\UPGRADE FunctionEnd ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called after the installation ends. Used to remove temporary RDK folders. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function .onGUIEnd ; remove the temporary rdk install folder RMDir /r $INSTDIR\UPGRADE FunctionEnd ######################################################################################### # Functions ######################################################################################### ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called after the user chooses a directory. Used to verify that the selected folder ; contains oinsight.exe and oengine.exe and to add those EXEs to the Windows Firewall ; Exception list. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function DirectoryLeave ; look for oinsight.exe ${IfNot} ${FileExists} "$INSTDIR\oinsight.exe" ${OrIfNot} ${FileExists} "$INSTDIR\oengine.dll" MessageBox MB_OK|MB_ICONEXCLAMATION "Could not find oinsight.exe or oengine.dll in $INSTDIR.$\r$\n$\r$\nPlease select another location." Abort ${EndIf} ; add oinsight.exe, oengine.exe, and this installer to the Windows Firewall exception list to avoid annoying popups srputil::addFirewallException /NOUNLOAD "$EXEPATH" "${PRODUCT_NAME} Installer" srputil::addFirewallException /NOUNLOAD "$INSTDIR\oinsight.exe" "$INSTDIR\oinsight.exe" srputil::addFirewallException /NOUNLOAD "$INSTDIR\oengine.exe" "$INSTDIR\oengine.exe" ; set the directory as the new install location SetOutPath $INSTDIR FunctionEnd ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Creates the Application Login Page. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function ApplicationLoginPage ; set the headers !insertmacro MUI_HEADER_TEXT "Click Install to continue." " " ; create the dialog nsDialogs::Create /NOUNLOAD 1018 Pop $R0 ${If} $R0 == error MessageBox MB_OK|MB_ICONINFORMATION "Unable to create Login page. Install aborted." Abort ${EndIf} ; add the main label ;${NSD_CreateLabel} 0u 0u -1u 16u "Please enter the application login credentials. You must supply a valid user name and $\r$\npassword to complete the setup." ${NSD_CreateLabel} 0u 0u -1u 16u "Please click <Install> to continue with the upgrade" Pop $R0 ; add the caution label (and make it bold) ${NSD_CreateLabel} 0u 24u -1u 8u "CAUTION: OpenInsight might need to be shut down for setup to continue." Pop $R0 CreateFont $R1 "$(^Font)" "8" "700" SendMessage $R0 ${WM_SETFONT} $R1 1 ; add the APPLICATION label ${NSD_CreateLabel} 0u 41u -1u 8u "Application" Pop $R0 ; add the APPLICATION field (uppercase only) nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${__NSD_Text_STYLE}|${ES_UPPERCASE} ${__NSD_Text_EXSTYLE} 0u 52u -1u 13u $OI_APP Pop $CTRL_APP ; add the USERNAME label ${NSD_CreateLabel} 0u 73u -1u 8u "Username" Pop $R0 ; add the USERNAME field (uppercase only) nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${__NSD_Text_STYLE}|${ES_UPPERCASE} ${__NSD_Text_EXSTYLE} 0u 84u -1u 13u $OI_USERNAME Pop $CTRL_USERNAME ; add the PASSWORD label ${NSD_CreateLabel} 0u 107u -1u 8u "Password" Pop $R0 ; add the PASSWORD field nsDialogs::CreateControl /NOUNLOAD ${__NSD_Password_CLASS} ${__NSD_Password_STYLE}|${ES_UPPERCASE} ${__NSD_Password_EXSTYLE} 0u 116u -1u 13u $OI_PASSWORD Pop $CTRL_PASSWORD ${NSD_SetFocus} $CTRL_PASSWORD ; show it nsDialogs::Show FunctionEnd ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called when leaving the Application Login Page; caches the login information and ; attempts a login, for verification. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function ApplicationLoginLeave ; get the login credentials ;${NSD_GetText} $CTRL_APP $OI_APP ;${NSD_GetText} $CTRL_USERNAME $OI_USERNAME ;${NSD_GetText} $CTRL_PASSWORD $OI_PASSWORD ; attempt to login ;srputil::startOI /NOUNLOAD $OI_APP $OI_USERNAME $OI_PASSWORD srputil::startOI /NOUNLOAD "BSBS" "BARRY" "" ; validate credentials ${If} $0 != "1" MessageBox MB_OK|MB_ICONSTOP $0 ${If} $0 == "Invalid application" ; If application was invalid, move focus to Application field and select all ${NSD_SetFocus} $CTRL_APP SendMessage $CTRL_APP ${EM_SETSEL} 0 -1 ${Else} ; If login was invalid, move focus to Username field and select all ${NSD_SetFocus} $CTRL_USERNAME SendMessage $CTRL_USERNAME ${EM_SETSEL} 0 -1 ${EndIf} Abort ${EndIf} FunctionEnd ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called before the RDK files are written to disk. Used to clear any existing RDK ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function InstallPre ; empty out the temp rdk folder ${If} ${FileExists} "$INSTDIR\UPGRADE\*.*" Delete $INSTDIR\UPGRADE\*.* ${EndIf} FunctionEnd ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Called after the RDK files are written to disk. Used to run OI's RDKINSTALL routine ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function InstallLeave ; Execute RDKINSTALL, we don't need to call startOI because we did that during the ; Application Login Page's leave event. Note that runCommand will route messages form ; OI to the InstFiles page window... it even updates the progress bar! SetOutPath $INSTDIR srputil::runCommand /NOUNLOAD 'RUN RDKINSTALL "$INSTDIR\UPGRADE"' srputil::runCommand /NOUNLOAD 'RUN UPDATE_INDEX' srputil::shutdownOI ; remove the temporary rdk install folder RMDir /r $INSTDIR\UPGRADE FunctionEnd
  • The only differences I can see are:

    I use SRPRDKINSTALL not UPGRADE
    You reference oinsightexe I reference oinsight.exe
    I prompt for app, username, and password.
    I run RDKINSTALL and you run UPDATE_INDEX

    Any ideas anyone?
  • When do you get this error? During compilation or when running the installer?
  • Running the installer after the prompt for app, username.
  • Does the value in DEFAULT_OI_DIR point to a folder with both oinsight.exe and revcap32.dll in that folder directly, or is your OI app in a subfolder of C:\Test?
  • I tried doing it differently. I backed up my OI32 folder and tried installing directly to that folder to make sure it wasn't something do with copying the install, I see the same problem when using this folder.

    [C:\oi32]DIR REVCAP32.dll

    Volume in drive C is Local Disk Serial number is c034:a84e
    Directory of C:\oi32\REVCAP32.dll

    2/12/2013 17:13 77,824 REVCAP32.dll
    77,824 bytes in 1 file and 0 dirs 77,824 bytes allocated
    346,210,140,160 bytes free

    [C:\oi32]DIR OINSIGHT.exe

    Volume in drive C is Local Disk Serial number is c034:a84e
    Directory of C:\oi32\OINSIGHT.exe

    12/04/2018 9:41 593,920 OINSIGHT.exe
    593,920 bytes in 1 file and 0 dirs 593,920 bytes allocated
    346,209,452,032 bytes free
  • It's hard for me to nail down the cause, but I can tell you why the error occurs. The current working directory is determined by the SetOutPath command in the script. This is set to whatever directory you select in the Directory screen. After you enter in your credentials, the "srputil" plugin tries to log into windows. This plugin uses REVCAP32.DLL, and windows relies on the current working directory to find that DLL, which it can't find for some reason.

    I'm not sure why you are getting this error. We know for sure that you are choosing a directory with oinsight.exe and oengine.dll because the script checks for those two files (see Function DirectoryLeave). Since oinsighte.exe cannot run without revcap32.dll, there's no reason the plugin couldn't do it unless there was some kind of anti-virus software preventing it.
  • I just did a search for revcap32 in the registry, it was not found, does this mean it needs registering?
  • Nope. Regsvr32 is not meant to be registered. Windows looks for DLL using a standard list of directories. It looks in the current directory, then System32, then any directories in the environment's PATH variable.
  • Hmm then somehow current directory must be wrong.
  • The only way to find out is to debug the script, and the only way to debug NSIS is to place MessageBox statements in our code to display values. In this case, you want to examine the $OUTDIR variable.
  • ; attempt to login
    MessageBox MB_OK "$INSTDIR"
    SetOutPath $INSTDIR
    srputil::startOI /NOUNLOAD $OI_APP $OI_USERNAME $OI_PASSWORD

    Message displayed is c:\OI32 which is correct and adding SetOutPath line makes no difference.
  • I don't think I have an answer for you. The DLL is there but Windows isn't finding it. (BTW, that error message is not coming from NSIS or the SRPUTIL plugin. That is Windows). My only guess is that something is preventing the installer from seeing it. Perhaps see if the installer gets the same error in another environment? I could test it on my end if you send me a dropbox link or something.
  • Good idea, let me test on another machine.
  • Wow. Good catch. I bet that is exactly the issue. I was not aware NSIS added that.
  • Not sure if this helps but if I add a MessageBox right after loading of the engine and use sysinternals Procexp.exe, no OENGINE is loaded.

    ; attempt to login
    srputil::startOI /NOUNLOAD $OI_APP $OI_USERNAME $OI_PASSWORD
    MessageBox MB_OK "Test1"
  • That's not surprising because REVCAP32.DLL is supposed to load the engine, and the DLL can't be found. I'm almost certain you need to use the solution in the above stack overflow link.
  • This fixes it:

    Function DirectoryLeave

    ; look for oinsight.exe
    ${IfNot} ${FileExists} "$INSTDIR\oinsight.exe"
    ${OrIfNot} ${FileExists} "$INSTDIR\oengine.dll"
    MessageBox MB_OK|MB_ICONEXCLAMATION "Could not find oinsight.exe or oengine.dll in $INSTDIR.$\r$\n$\r$\nPlease select another location."
    Abort
    ${EndIf}

    System::Call 'KERNEL32::AddDllDirectory(w "$INSTDIR")'

    ; add oinsight.exe, oengine.exe, and this installer to the Windows Firewall exception list to avoid annoying popups
    srputil::addFirewallException /NOUNLOAD "$EXEPATH" "${PRODUCT_NAME} Installer"
    srputil::addFirewallException /NOUNLOAD "$INSTDIR\oinsight.exe" "$INSTDIR\oinsight.exe"
    srputil::addFirewallException /NOUNLOAD "$INSTDIR\oengine.exe" "$INSTDIR\oengine.exe"

    ; set the directory as the new install location
    SetOutPath $INSTDIR

    FunctionEnd
  • I learned something new today. Thanks.
  • You are welcome, thanks for pointing me in the right direction.
  • edited June 2021
    @jimvaughan could you send me your complete modified script please.
    TIA

    barry@bsbsoft.com.au
Sign In or Register to comment.