; Script generated by the HM NIS Edit Script Wizard. ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "GeomativeStudio" !define PRODUCT_VERSION "1.0" !define PRODUCT_PUBLISHER "Geomative, Inc." !define PRODUCT_WEB_SITE "http://www.Geomative.com" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Geomative Studio.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" ; MUI 1.67 compatible ------ !include "MUI2.nsh" !include "x64.nsh" !include LogicLib.nsh !include Integration.nsh ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !define MUI_FINISHPAGE_RUN "$INSTDIR\Geomative Studio.exe" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files !insertmacro MUI_LANGUAGE "English" ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "GeomativeStudioSetup.exe" InstallDir "$PROGRAMFILES\GeomativeStudio" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show RequestExecutionLevel admin !macro EnsureAdminRights UserInfo::GetAccountType Pop $0 ${If} $0 != "admin" ; Require admin rights on WinNT4+ MessageBox MB_IconStop "Administrator rights required!" SetErrorLevel 740 ; ERROR_ELEVATION_REQUIRED Quit ${EndIf} !macroend Function .onInit SetShellVarContext All !insertmacro EnsureAdminRights FunctionEnd ;!macro customInstall ; WriteRegStr HKCU "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" ; ; WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" ; WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" ;!macroend Section "Geomative Studio" SEC01 SetOutPath "$INSTDIR" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\config.ini" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\database_modify.xml" SetOutPath "$INSTDIR\DB" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\DB\GeoMativeDB.accdb" SetOutPath "$INSTDIR" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\Geomative Studio.exe" CreateDirectory "$SMPROGRAMS\GeomativeStudio" CreateShortCut "$SMPROGRAMS\GeomativeStudio\GeomativeStudio.lnk" "$INSTDIR\Geomative Studio.exe" CreateShortCut "$DESKTOP\GeomativeStudio.lnk" "$INSTDIR\Geomative Studio.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\vc_redist.x64.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\vc_redist.x86.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\msado15.dll" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\msadox.dll" SetOutPath "$INSTDIR\LOG" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\commLog.txt" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\detect_gd20_log.txt" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\device_log.txt" SetOutPath "$INSTDIR\LOG\general" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\general\20211110.txt" SetOutPath "$INSTDIR\LOG" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\td_time_error.txt" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\LOG\update_db.log" SetOutPath "$INSTDIR\tools\dfu_tools" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\COPYING.txt" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\dfu-suffix.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\dfu-util.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\DfuCreateFile.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\STDFU.dll" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\STDFUFiles.dll" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\STDFUPRT.dll" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\dfu_tools\STTubeDevice30.dll" SetOutPath "$INSTDIR\tools" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\IAP-GD10.bat" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\tools\License-GD10.bat" SetOutPath "$INSTDIR" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\upGeoMative.exe" File "E:\R&D\GeomativeStudio\Install\Geomative Studio\version_info.txt" SectionEnd Section "Drivers" SEC02 SetOutPath "$INSTDIR\x64" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\dpinst.xml" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\dpinst_amd64.exe" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\mdmcpq.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\stmcdc.cat" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\stmcdc.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\stmcdc_g.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\STTub30.sys" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\sttube.cat" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\STtube.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\usbser.sys" SetOutPath "$INSTDIR\x64\x64" File "E:\R&D\GeomativeStudio\Install\GD_10\x64\x64\STTub30.sys" SetOutPath "$INSTDIR\x86" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\dpinst.xml" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\dpinst_x86.exe" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\mdmcpq.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\stmcdc.cat" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\stmcdc.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\stmcdc_g.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\STTub30.sys" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\sttube.cat" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\STtube.inf" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\usbser.sys" SetOutPath "$INSTDIR\x86\x86" File "E:\R&D\GeomativeStudio\Install\GD_10\x86\x86\STTub30.sys" SectionEnd Section "DBConntEngine" SEC03 SetOutPath "$INSTDIR" File "E:\R&D\GeomativeStudio\Install\DBConntEngine\AccessDatabaseEngine.exe" SectionEnd Section "ASADMIN" SEC04 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" ; ; WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\Geomative Studio.exe" "RUNASADMIN" SectionEnd ; ExecWait ‘vcredist_x86.exe’ # 一般的安装 ;ExecWait ‘”vcredist_x86.exe” /q’ # silent install 静默安装 ; ExecWait ‘”vcredist_x86.exe” /q:a’ # silent install, display a progress dialog but requires no user interaction. ; ExecWait ‘”vcredist_x86.exe” /qb’ # unattended install 无人值守安装 ; ExecWait ‘vcredist_x86.exe /q:a /c:”msiexec /i vcredist.msi /qb! /l*v $TEMP\vcredist_x86.log” ‘ # suppress all UI during installation. Section ${If} ${RunningX64} ExecWait '"$INSTDIR\vc_redist.x64.exe"' ${Else} ExecWait '"$INSTDIR\vc_redist.x86.exe"' ${EndIf} SectionEnd Section ${If} ${RunningX64} ;ExecShell "$INSTDIR\x64\dpinst_amd64.exe" "" "/quiet" ;ExecWait '"$INSTDIR\x64\dpinst_amd64.exe" /PATH "$INSTDIR\x64"' ExecWait '"$INSTDIR\x64\dpinst_amd64.exe" /PATH "$INSTDIR\x64"' ${Else} ;ExecShell "$INSTDIR\x86\dpinst_x86.exe" "" "/quiet" ExecWait '"$INSTDIR\x86\dpinst_x86.exe" /PATH "$INSTDIR\x86"' ${EndIf} SectionEnd Section ;ExecWait '"$INSTDIR\AccessDatabaseEngine.exe" /q' ExecWait '"$INSTDIR\AccessDatabaseEngine.exe"' SectionEnd Section -AdditionalIcons WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\GeomativeStudio\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\GeomativeStudio\Uninstall.lnk" "$INSTDIR\uninst.exe" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Geomative Studio.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Geomative Studio.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) Successfully removed from your computer." FunctionEnd Function un.onInit MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) ,and all its components?" IDYES +2 Abort FunctionEnd Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\AccessDatabaseEngine.exe" Delete "$INSTDIR\x86\x86\STTub30.sys" Delete "$INSTDIR\x86\usbser.sys" Delete "$INSTDIR\x86\STtube.inf" Delete "$INSTDIR\x86\sttube.cat" Delete "$INSTDIR\x86\STTub30.sys" Delete "$INSTDIR\x86\stmcdc_g.inf" Delete "$INSTDIR\x86\stmcdc.inf" Delete "$INSTDIR\x86\stmcdc.cat" Delete "$INSTDIR\x86\mdmcpq.inf" Delete "$INSTDIR\x86\dpinst_x86.exe" Delete "$INSTDIR\x86\dpinst.xml" Delete "$INSTDIR\x64\x64\STTub30.sys" Delete "$INSTDIR\x64\usbser.sys" Delete "$INSTDIR\x64\STtube.inf" Delete "$INSTDIR\x64\sttube.cat" Delete "$INSTDIR\x64\STTub30.sys" Delete "$INSTDIR\x64\stmcdc_g.inf" Delete "$INSTDIR\x64\stmcdc.inf" Delete "$INSTDIR\x64\stmcdc.cat" Delete "$INSTDIR\x64\mdmcpq.inf" Delete "$INSTDIR\x64\dpinst_amd64.exe" Delete "$INSTDIR\x64\dpinst.xml" Delete "$INSTDIR\version_info.txt" Delete "$INSTDIR\upGeoMative.exe" Delete "$INSTDIR\tools\License-GD10.bat" Delete "$INSTDIR\tools\IAP-GD10.bat" Delete "$INSTDIR\tools\dfu_tools\STTubeDevice30.dll" Delete "$INSTDIR\tools\dfu_tools\STDFUPRT.dll" Delete "$INSTDIR\tools\dfu_tools\STDFUFiles.dll" Delete "$INSTDIR\tools\dfu_tools\STDFU.dll" Delete "$INSTDIR\tools\dfu_tools\DfuCreateFile.exe" Delete "$INSTDIR\tools\dfu_tools\dfu-util.exe" Delete "$INSTDIR\tools\dfu_tools\dfu-suffix.exe" Delete "$INSTDIR\tools\dfu_tools\COPYING.txt" Delete "$INSTDIR\msadox.dll" Delete "$INSTDIR\msado15.dll" Delete "$INSTDIR\LOG\update_db.log" Delete "$INSTDIR\LOG\td_time_error.txt" Delete "$INSTDIR\LOG\general\20211110.txt" Delete "$INSTDIR\LOG\device_log.txt" Delete "$INSTDIR\LOG\detect_gd20_log.txt" Delete "$INSTDIR\LOG\commLog.txt" Delete "$INSTDIR\vc_redist.x64.exe" Delete "$INSTDIR\vc_redist.x86.exe" Delete "$INSTDIR\Geomative Studio.exe" Delete "$INSTDIR\DB\GeoMativeDB.accdb" Delete "$INSTDIR\database_modify.xml" Delete "$INSTDIR\config.ini" Delete "$SMPROGRAMS\GeomativeStudio\Uninstall.lnk" Delete "$SMPROGRAMS\GeomativeStudio\Website.lnk" Delete "$DESKTOP\GeomativeStudio.lnk" Delete "$SMPROGRAMS\GeomativeStudio\GeomativeStudio.lnk" RMDir "$SMPROGRAMS\GeomativeStudio" RMDir "$INSTDIR\x86\x86" RMDir "$INSTDIR\x86" RMDir "$INSTDIR\x64\x64" RMDir "$INSTDIR\x64" RMDir "$INSTDIR\tools\dfu_tools" RMDir "$INSTDIR\tools" RMDir "$INSTDIR\LOG\general" RMDir "$INSTDIR\LOG" RMDir "$INSTDIR\DB" RMDir "$INSTDIR\CACHE" RMDir /r "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd