/resources/setup.nsi
https://code.google.com/p/parsets/ · Unknown · 177 lines · 158 code · 19 blank · 0 comment · 0 complexity · a9e838f88111c7c8dc50d4840aa75fb7 MD5 · raw file
- # Auto-generated by EclipseNSIS Script Wizard
- # May 6, 2009 4:07:04 PM
-
- Name "Parallel Sets"
-
- # General Symbol Definitions
- !define REGKEY "SOFTWARE\$(^Name)"
- !define VERSION 2.1
- !define COMPANY "UNC Charlotte"
- !define URL "http://eagereyes.org/parallel-sets"
-
- # MUI Symbol Definitions
- !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\classic-install.ico"
- !define MUI_FINISHPAGE_NOAUTOCLOSE
- !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
- !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
- !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
- !define MUI_STARTMENUPAGE_DEFAULTFOLDER "Parallel Sets"
- !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\classic-uninstall.ico"
- !define MUI_UNFINISHPAGE_NOAUTOCLOSE
-
- # Included files
- !include Sections.nsh
- !include MUI.nsh
-
- # Variables
- Var StartMenuGroup
-
- # Installer pages
- !insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_LICENSE "C:\Parallel Sets Installation\License.txt"
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_PAGE_FINISH
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
-
- # Installer languages
- !insertmacro MUI_LANGUAGE English
-
- # Installer attributes
- OutFile "Parallel Sets 2.1 Setup.exe"
- InstallDir "$PROGRAMFILES\Parallel Sets"
- CRCCheck on
- XPStyle on
- ShowInstDetails show
- VIProductVersion 2.0.0.0
- VIAddVersionKey ProductName "Parallel Sets"
- VIAddVersionKey ProductVersion "${VERSION}"
- VIAddVersionKey FileVersion "${VERSION}"
- VIAddVersionKey FileDescription ""
- VIAddVersionKey LegalCopyright ""
- InstallDirRegKey HKLM "${REGKEY}" Path
- ShowUninstDetails show
-
- # Installer sections
- !macro CREATE_SMGROUP_SHORTCUT NAME PATH
- Push "${NAME}"
- Push "${PATH}"
- Call CreateSMGroupShortcut
- !macroend
-
- Section -Main SEC0000
- SetOutPath $INSTDIR
- SetOverwrite on
- File /r "C:\Parallel Sets Installation\Parallel Sets Files\*"
- SetOutPath "$APPDATA\Parallel Sets"
- File /r "C:\Parallel Sets Installation\Parallel Sets Application Data\*"
- CreateDirectory "$SMPROGRAMS\$StartMenuGroup"
- SetOutPath $INSTDIR
- CreateShortcut "$DESKTOP\Parallel Sets.lnk" "$INSTDIR\Parallel Sets.exe"
- #SetOutPath $SMPROGRAMS\$StartMenuGroup
- SetOutPath $INSTDIR
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Parallel Sets.lnk" "$INSTDIR\Parallel Sets.exe"
- #!insertmacro CREATE_SMGROUP_SHORTCUT "Parallel Sets" "$INSTDIR\Parallel Sets.exe"
- WriteRegStr HKLM "${REGKEY}\Components" Main 1
- SectionEnd
-
- Section -post SEC0001
- WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
- SetOutPath $INSTDIR
- WriteUninstaller $INSTDIR\uninstall.exe
- !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
- SetOutPath $SMPROGRAMS\$StartMenuGroup
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
- !insertmacro MUI_STARTMENU_WRITE_END
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
- WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
- WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
- SectionEnd
-
- # Macro for selecting uninstaller sections
- !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
- Push $R0
- ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
- StrCmp $R0 1 0 next${UNSECTION_ID}
- !insertmacro SelectSection "${UNSECTION_ID}"
- GoTo done${UNSECTION_ID}
- next${UNSECTION_ID}:
- !insertmacro UnselectSection "${UNSECTION_ID}"
- done${UNSECTION_ID}:
- Pop $R0
- !macroend
-
- # Uninstaller sections
- !macro DELETE_SMGROUP_SHORTCUT NAME
- Push "${NAME}"
- Call un.DeleteSMGroupShortcut
- !macroend
-
- Section /o -un.Main UNSEC0000
- !insertmacro DELETE_SMGROUP_SHORTCUT "Parallel Sets"
- Delete /REBOOTOK "$DESKTOP\Parallel Sets.lnk"
- RmDir /r /REBOOTOK "$APPDATA\Parallel Sets"
- RmDir /r /REBOOTOK $INSTDIR
- DeleteRegValue HKLM "${REGKEY}\Components" Main
- SectionEnd
-
- Section -un.post UNSEC0001
- DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
- Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
- Delete /REBOOTOK $INSTDIR\uninstall.exe
- DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
- DeleteRegValue HKLM "${REGKEY}" Path
- DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
- DeleteRegKey /IfEmpty HKLM "${REGKEY}"
- RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
- RmDir /REBOOTOK $INSTDIR
- Push $R0
- StrCpy $R0 $StartMenuGroup 1
- StrCmp $R0 ">" no_smgroup
- no_smgroup:
- Pop $R0
- SectionEnd
-
- # Installer functions
- Function .onInit
- InitPluginsDir
- FunctionEnd
- ;
- ;Function CreateSMGroupShortcut
- ; Exch $R0 ;PATH
- ; Exch
- ; Exch $R1 ;NAME
- ; Push $R2
- ; StrCpy $R2 $StartMenuGroup 1
- ; StrCmp $R2 ">" no_smgroup
- ; #SetOutPath $SMPROGRAMS\$StartMenuGroup
- ; CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$R1.lnk" $R0
- ;no_smgroup:
- ; Pop $R2
- ; Pop $R1
- ; Pop $R0
- ;FunctionEnd
-
- # Uninstaller functions
- Function un.onInit
- ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
- !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
- !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
- FunctionEnd
-
- Function un.DeleteSMGroupShortcut
- Exch $R1 ;NAME
- Push $R2
- StrCpy $R2 $StartMenuGroup 1
- StrCmp $R2 ">" no_smgroup
- Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$R1.lnk"
- no_smgroup:
- Pop $R2
- Pop $R1
- FunctionEnd