PageRenderTime 38ms CodeModel.GetById 27ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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