/resources/setup.nsi

https://code.google.com/p/parsets/ · Unknown · 177 lines · 158 code · 19 blank · 0 comment · 0 complexity · a9e838f88111c7c8dc50d4840aa75fb7 MD5 · raw file

  1. # Auto-generated by EclipseNSIS Script Wizard
  2. # May 6, 2009 4:07:04 PM
  3. Name "Parallel Sets"
  4. # General Symbol Definitions
  5. !define REGKEY "SOFTWARE\$(^Name)"
  6. !define VERSION 2.1
  7. !define COMPANY "UNC Charlotte"
  8. !define URL "http://eagereyes.org/parallel-sets"
  9. # MUI Symbol Definitions
  10. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\classic-install.ico"
  11. !define MUI_FINISHPAGE_NOAUTOCLOSE
  12. !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
  13. !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
  14. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
  15. !define MUI_STARTMENUPAGE_DEFAULTFOLDER "Parallel Sets"
  16. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\classic-uninstall.ico"
  17. !define MUI_UNFINISHPAGE_NOAUTOCLOSE
  18. # Included files
  19. !include Sections.nsh
  20. !include MUI.nsh
  21. # Variables
  22. Var StartMenuGroup
  23. # Installer pages
  24. !insertmacro MUI_PAGE_WELCOME
  25. !insertmacro MUI_PAGE_LICENSE "C:\Parallel Sets Installation\License.txt"
  26. !insertmacro MUI_PAGE_DIRECTORY
  27. !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
  28. !insertmacro MUI_PAGE_INSTFILES
  29. !insertmacro MUI_PAGE_FINISH
  30. !insertmacro MUI_UNPAGE_CONFIRM
  31. !insertmacro MUI_UNPAGE_INSTFILES
  32. # Installer languages
  33. !insertmacro MUI_LANGUAGE English
  34. # Installer attributes
  35. OutFile "Parallel Sets 2.1 Setup.exe"
  36. InstallDir "$PROGRAMFILES\Parallel Sets"
  37. CRCCheck on
  38. XPStyle on
  39. ShowInstDetails show
  40. VIProductVersion 2.0.0.0
  41. VIAddVersionKey ProductName "Parallel Sets"
  42. VIAddVersionKey ProductVersion "${VERSION}"
  43. VIAddVersionKey FileVersion "${VERSION}"
  44. VIAddVersionKey FileDescription ""
  45. VIAddVersionKey LegalCopyright ""
  46. InstallDirRegKey HKLM "${REGKEY}" Path
  47. ShowUninstDetails show
  48. # Installer sections
  49. !macro CREATE_SMGROUP_SHORTCUT NAME PATH
  50. Push "${NAME}"
  51. Push "${PATH}"
  52. Call CreateSMGroupShortcut
  53. !macroend
  54. Section -Main SEC0000
  55. SetOutPath $INSTDIR
  56. SetOverwrite on
  57. File /r "C:\Parallel Sets Installation\Parallel Sets Files\*"
  58. SetOutPath "$APPDATA\Parallel Sets"
  59. File /r "C:\Parallel Sets Installation\Parallel Sets Application Data\*"
  60. CreateDirectory "$SMPROGRAMS\$StartMenuGroup"
  61. SetOutPath $INSTDIR
  62. CreateShortcut "$DESKTOP\Parallel Sets.lnk" "$INSTDIR\Parallel Sets.exe"
  63. #SetOutPath $SMPROGRAMS\$StartMenuGroup
  64. SetOutPath $INSTDIR
  65. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Parallel Sets.lnk" "$INSTDIR\Parallel Sets.exe"
  66. #!insertmacro CREATE_SMGROUP_SHORTCUT "Parallel Sets" "$INSTDIR\Parallel Sets.exe"
  67. WriteRegStr HKLM "${REGKEY}\Components" Main 1
  68. SectionEnd
  69. Section -post SEC0001
  70. WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
  71. SetOutPath $INSTDIR
  72. WriteUninstaller $INSTDIR\uninstall.exe
  73. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  74. SetOutPath $SMPROGRAMS\$StartMenuGroup
  75. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
  76. !insertmacro MUI_STARTMENU_WRITE_END
  77. WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
  78. WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
  79. WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
  80. WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
  81. WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
  82. WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
  83. SectionEnd
  84. # Macro for selecting uninstaller sections
  85. !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
  86. Push $R0
  87. ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
  88. StrCmp $R0 1 0 next${UNSECTION_ID}
  89. !insertmacro SelectSection "${UNSECTION_ID}"
  90. GoTo done${UNSECTION_ID}
  91. next${UNSECTION_ID}:
  92. !insertmacro UnselectSection "${UNSECTION_ID}"
  93. done${UNSECTION_ID}:
  94. Pop $R0
  95. !macroend
  96. # Uninstaller sections
  97. !macro DELETE_SMGROUP_SHORTCUT NAME
  98. Push "${NAME}"
  99. Call un.DeleteSMGroupShortcut
  100. !macroend
  101. Section /o -un.Main UNSEC0000
  102. !insertmacro DELETE_SMGROUP_SHORTCUT "Parallel Sets"
  103. Delete /REBOOTOK "$DESKTOP\Parallel Sets.lnk"
  104. RmDir /r /REBOOTOK "$APPDATA\Parallel Sets"
  105. RmDir /r /REBOOTOK $INSTDIR
  106. DeleteRegValue HKLM "${REGKEY}\Components" Main
  107. SectionEnd
  108. Section -un.post UNSEC0001
  109. DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
  110. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
  111. Delete /REBOOTOK $INSTDIR\uninstall.exe
  112. DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
  113. DeleteRegValue HKLM "${REGKEY}" Path
  114. DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
  115. DeleteRegKey /IfEmpty HKLM "${REGKEY}"
  116. RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
  117. RmDir /REBOOTOK $INSTDIR
  118. Push $R0
  119. StrCpy $R0 $StartMenuGroup 1
  120. StrCmp $R0 ">" no_smgroup
  121. no_smgroup:
  122. Pop $R0
  123. SectionEnd
  124. # Installer functions
  125. Function .onInit
  126. InitPluginsDir
  127. FunctionEnd
  128. ;
  129. ;Function CreateSMGroupShortcut
  130. ; Exch $R0 ;PATH
  131. ; Exch
  132. ; Exch $R1 ;NAME
  133. ; Push $R2
  134. ; StrCpy $R2 $StartMenuGroup 1
  135. ; StrCmp $R2 ">" no_smgroup
  136. ; #SetOutPath $SMPROGRAMS\$StartMenuGroup
  137. ; CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$R1.lnk" $R0
  138. ;no_smgroup:
  139. ; Pop $R2
  140. ; Pop $R1
  141. ; Pop $R0
  142. ;FunctionEnd
  143. # Uninstaller functions
  144. Function un.onInit
  145. ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
  146. !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
  147. !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
  148. FunctionEnd
  149. Function un.DeleteSMGroupShortcut
  150. Exch $R1 ;NAME
  151. Push $R2
  152. StrCpy $R2 $StartMenuGroup 1
  153. StrCmp $R2 ">" no_smgroup
  154. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$R1.lnk"
  155. no_smgroup:
  156. Pop $R2
  157. Pop $R1
  158. FunctionEnd