Hello,
I was hoping the VB6 runtimes would solve this but still no go. When running this install on Win 7 it installs fine but when I run the app I get this error "Component 'Comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid" and it crashes.
I have an old (2002) Installshield Express build that will install this app correctly on 7/10 and it does run, but I'm trying to break away from that with my own installer.
Could it be...
A. I'm missing a system file or something is not registering during the install?
B. that Installshield is downgrading a system file? Once that old installer is run on a new system my NSIS installs work fine.
C. my build is on XP, is it possible that newer system files aren't backwards compatible? i.e. setup VB6 on Win 10 and rebuild the exe?
code:
; Define the application name
!define APPNAME "WinShear32 Viewer"
!define APPNAMEANDVERSION "WinShear32 Viewer 1.0.7"
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\WinShear32 Viewer"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "WinShear32-Viewer_Setup.exe"
Icon C:\WS\NSIS\WS32v\WinShear32.ico
; Request application privileges for Windows Vista/7/10
RequestExecutionLevel admin
; Modern interface settings
!include "MUI2.nsh"
!include "Sections.nsh"
!include "FileAssociation.nsh"
!include "FileFunc.nsh"
!include "x64.nsh"
!include VB6RunTime.nsh
Var AlreadyInstalled
;Interface Settigns
!define MUI_ABORTWARNING
!define MUI_ICON "..\NSIS\WS32v\WinShear32.ico"
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\NSIS\WS32v\WS32vLicense.rtf"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro RefreshShellIcons
Section "-Install VB6 run-time files"
;Add code here that sets $AlreadyInstalled to a non-zero value
;if the application is already installed. For example:
;(Replace MyApp.exe with your application filename)
IfFileExists "$INSTDIR\WS32viewer.exe" 0 new_installation
StrCpy $AlreadyInstalled 1
new_installation:
;Replace C:\vb6runtimes with the location of the files
!insertmacro VB6RunTimeInstall C:\WS\NSIS\vb6runtimes $AlreadyInstalled
SectionEnd
Section "WinShear32 Viewer" Section1
; Set Section properties
SetOverwrite ifnewer
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
File "..\NSIS\WS32v\Pegraphs.gid"
File "..\NSIS\WS32v\Pegraphs.hlp"
File "..\NSIS\WS32v\Welcome.txt"
File "..\NSIS\WS32v\WS32viewer.exe"
File "..\NSIS\WS32v\Winshear32.ico"
File "..\NSIS\WS32v\WS32viewer.chm"
File "..\NSIS\WS32v\thermo_j.tbl"
File "..\NSIS\WS32v\thermo_k.tbl"
File "..\NSIS\WS32v\thermo_t.tbl"
File "..\NSIS\WS32v\Measurement of Fluid Rheology.pdf"
SetOutPath "$INSTDIR\files\"
File "..\NSIS\WS32v\files\A bob 1100.vis"
File "..\NSIS\WS32v\files\Blank.vis"
File "..\NSIS\WS32v\files\E bob 4400.vis"
File "..\NSIS\WS32v\files\FF bob 6600.vis"
File "..\NSIS\WS32v\files\F25 bob 8800.vis"
SetOutPath "$WINDIR\"
${If} ${RunningX64}
File "..\NSIS\WS32v\windows\64\WS32view.ini"
${Else}
File "..\NSIS\WS32v\windows\32\WS32view.ini"
${EndIf}
;These will go to Windows\sysWOW64 on 64 bit OS's
SetOutPath "$SYSDIR\"
File "..\NSIS\WS32v\system\TAB32X30.ocx"
File "..\NSIS\WS32v\system\Pesgo32a.ocx"
File "..\NSIS\WS32v\system\PEGRP32a.dll"
File "..\NSIS\WS32v\system\msflxgrd.ocx"
File "..\NSIS\WS32v\system\comctl32.ocx"
; File "..\NSIS\WS32v\system\comctl32.dll"
; File "..\NSIS\WS32v\system\msvbvm60.dll"
;Register some of these guys
RegDLL $SYSDIR\TAB32X30.ocx
RegDLL $SYSDIR\Pesgo32a.ocx
; RegDLL $SYSDIR\PEGRP32a.dll
RegDLL $SYSDIR\msflxgrd.ocx
RegDLL $SYSDIR\comctl32.ocx
; RegDLL $SYSDIR\msvbvm60.dll
CreateShortCut "$DESKTOP\WinShear32 Viewer.lnk" "$INSTDIR\WS32viewer.exe"
CreateShortCut "$DESKTOP\Measurement of Fluid Rheology.lnk" "$INSTDIR\Measurement of Fluid Rheology.pdf"
CreateDirectory "$SMPROGRAMS\WinShear32 Viewer"
CreateShortCut "$SMPROGRAMS\WinShear32 Viewer\WinShear32 Viewer.lnk" "$INSTDIR\WS32viewer.exe"
CreateShortCut "$SMPROGRAMS\WinShear32 Viewer\Measurement of Fluid Rheology.lnk" "$INSTDIR\Measurement of Fluid Rheology.pdf"
CreateShortCut "$SMPROGRAMS\WinShear32 Viewer\Uninstall.lnk" "$INSTDIR\uninstall.exe"
;Register the vis extension
${registerExtension} "c:\Program Files\WinShear32 Viewer\WS32viewer.exe" ".vis" "VIS_File"
;Assign the icon to vis files.
WriteRegStr HKCR "WS32viewer.Document\DefaultIcon" "" \
"$INSTDIR\WS32viewer.exe,1"
;Call RefreshShellIcons
SectionEnd
Section /o "Adobe Acrobat Reader" Section2
; Set Section properties
SetOverwrite ifnewer
; Set Section Files and Shortcuts
SetOutPath "$TEMP\"
; File "..\NSIS\WS32v\AdbeRdr11006_en_US.exe"
; ExecWait '"$TEMP\AdbeRdr11006_en_US.exe"'
SectionEnd
Section -FinishSection
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Installs the WinShear32 Viewer software to view and analyse the saved test data from the Hercules High Shear Viscometer."
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Install Adobe Acrobat Reader 11 to view the manuals in PDF format."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;Uninstall section
Section Uninstall
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
${unregisterExtension} ".vis" "VIS File"
; Delete self
Delete "$INSTDIR\uninstall.exe"
; Delete Shortcuts
Delete "$DESKTOP\WinShear32 Viewer.lnk"
Delete "$DESKTOP\Measurement of Fluid Rheology.lnk"
Delete "$SMPROGRAMS\WinShear32 Viewer\WinShear32 Viewer.lnk"
Delete "$SMPROGRAMS\WinShear32 Viewer\Measurement of Fluid Rheology.lnk"
Delete "$SMPROGRAMS\WinShear32 Viewer\Uninstall.lnk"
; Clean up WinShear32 Viewer
Delete "$INSTDIR\Pegraphs.gid"
Delete "$INSTDIR\Pegraphs.hlp"
Delete "$INSTDIR\Welcome.txt"
Delete "$INSTDIR\WS32viewer.exe"
Delete "$INSTDIR\Winshear32.ico"
Delete "$INSTDIR\WS32viewer.chm"
Delete "$INSTDIR\thermo_j.tbl"
Delete "$INSTDIR\thermo_k.tbl"
Delete "$INSTDIR\thermo_t.tbl"
Delete "$INSTDIR\Measurement of Fluid Rheology.pdf"
;Clean up the default files
Delete "$INSTDIR\files\A bob 1100.vis"
Delete "$INSTDIR\files\Blank.vis"
Delete "$INSTDIR\files\E bob 4400.vis"
Delete "$INSTDIR\files\FF bob 6600.vis"
Delete "$INSTDIR\files\F25 bob 8800.vis"
;Clean up proprietary system files
Delete "$SYSDIR\TAB32X30.ocx"
Delete "$SYSDIR\Pesgo32a.ocx"
Delete "$SYSDIR\PEGRP32a.dll"
Delete "$WINDIR\WS32view.ini"
; Clean up Adobe Acrobat Reader
Delete "$TEMP\AdbeRdr11006_en_US.exe"
; Remove remaining directories
RMDir "$SMPROGRAMS\WinShear32 Viewer\files"
RMDir "$SMPROGRAMS\WinShear32 Viewer"
RMDir "$INSTDIR\"
SectionEnd
Section "-un.Uninstall VB6 run-time files"
!insertmacro VB6RunTimeUnInstall
SectionEnd
BrandingText "2018 Kaltec Scientific, Inc."
; eof
Thanks for any input.