1 ;NSIS Modern User Interface
2 ;Start Menu Folder Selection Example Script
3 ;Written by Joost Verburg
5 ;--------------------------------
10 ;--------------------------------
15 OutFile "openerp-client-setup.exe"
17 ;Default installation folder
18 InstallDir "$PROGRAMFILES\OpenERP Client"
20 ;Get installation folder from registry if available
21 InstallDirRegKey HKCU "Software\OpenERP Client" ""
23 ;Vista redirects $SMPROGRAMS to all users without this
24 RequestExecutionLevel admin
26 ;--------------------------------
32 ;--------------------------------
35 !define MUI_ABORTWARNING
37 ;--------------------------------
40 !define MUI_ICON
".\bin\pixmaps\openerp.ico"
41 !define MUI_UNICON
".\bin\pixmaps\openerp.ico"
42 !define MUI_WELCOMEFINISHPAGE_BITMAP
".\bin\pixmaps\openerp-intro.bmp"
43 !define MUI_HEADERIMAGE
44 !define MUI_HEADERIMAGE_BITMAP
".\bin\pixmaps\openerp-header.bmp"
46 !insertmacro MUI_PAGE_WELCOME
47 !insertmacro MUI_PAGE_LICENSE
"doc\\License.rtf"
48 # !insertmacro MUI_PAGE_COMPONENTS
49 !insertmacro MUI_PAGE_DIRECTORY
51 ;Start Menu Folder Page Configuration
52 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
"HKCU"
53 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"Software\OpenERP Client"
54 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"OpenERP Client"
56 !insertmacro MUI_PAGE_STARTMENU Application
$STARTMENU_FOLDER
58 !insertmacro MUI_PAGE_INSTFILES
60 !define MUI_FINISHPAGE_NOAUTOCLOSE
61 !define MUI_FINISHPAGE_RUN
62 !define MUI_FINISHPAGE_RUN_CHECKED
63 !define MUI_FINISHPAGE_RUN_TEXT
"Start OpenERP Client"
64 !define MUI_FINISHPAGE_RUN_FUNCTION
"LaunchLink"
65 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
66 !define MUI_FINISHPAGE_SHOWREADME
$INSTDIR\README
.txt
67 !insertmacro MUI_PAGE_FINISH
70 !insertmacro MUI_UNPAGE_WELCOME
71 !insertmacro MUI_UNPAGE_CONFIRM
72 !insertmacro MUI_UNPAGE_INSTFILES
74 ;--------------------------------
77 !insertmacro MUI_LANGUAGE
"English"
79 ;--------------------------------
82 Section "OpenERP Client" SecOpenERPClient
86 ;ADD YOUR OWN FILES HERE...
89 SetOutPath "$INSTDIR\\GTK"
92 SetOutPath "$INSTDIR\\doc"
95 ;Store installation folder
96 WriteRegStr HKCU "Software\OpenERP Client" "" $INSTDIR
99 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Client" "DisplayName" "OpenERP Client (remove only)"
100 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Client" "UninstallString" "$INSTDIR\Uninstall.exe"
101 WriteUninstaller "$INSTDIR\Uninstall.exe"
103 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
106 CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
107 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenERP Client.lnk" "$INSTDIR\openerp-client.exe"
109 !insertmacro MUI_STARTMENU_WRITE_END
116 LangString DESC_SecOpenERPClient
${LANG_ENGLISH} "OpenERP Client."
118 ;Assign language strings to sections
119 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
120 !insertmacro MUI_DESCRIPTION_TEXT
${SecOpenERPClient} $(DESC_SecOpenERPClient
)
121 !insertmacro MUI_FUNCTION_DESCRIPTION_END
123 ;--------------------------------
128 ;ADD YOUR OWN FILES HERE...
131 Call un
.RmFilesButOne
133 Delete "$INSTDIR\matplotlibdata\*"
134 Delete "$INSTDIR\pict\*"
135 Delete "$INSTDIR\icons\*"
136 Delete "$INSTDIR\pixmaps\*"
137 Delete "$INSTDIR\pict\*"
138 Delete "$INSTDIR\po\*"
139 Push "$INSTDIR\themes"
141 Call un
.RmFilesButOne
142 Push "$INSTDIR\share"
144 Call un
.RmFilesButOne
145 Delete "$INSTDIR\doc\*"
149 Delete "$INSTDIR\Uninstall.exe"
156 RMDir "$INSTDIR\matplotlibdata"
157 RMDir "$INSTDIR\pict"
158 RMDir "$INSTDIR\icons"
159 RMDir "$INSTDIR\pixmaps"
161 Push "$INSTDIR\themes"
164 RMDir "$INSTDIR\themes"
165 Push "$INSTDIR\share"
168 RMDir "$INSTDIR\share"
172 !insertmacro MUI_STARTMENU_GETFOLDER Application
$MUI_TEMP
174 Delete "$SMPROGRAMS\$MUI_TEMP\OpenERP Client.lnk"
176 ;Delete empty start menu parent diretories
177 StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
182 GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
184 IfErrors startMenuDeleteLoopDone
186 StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
187 startMenuDeleteLoopDone:
189 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Client"
190 DeleteRegKey /ifempty
HKCU "Software\OpenERP Client"
195 ExecShell "" "$INSTDIR\openerp-client.exe"
198 Function un
.RmDirsButOne
199 Exch $R0 ; exclude dir
205 FindFirst $R3 $R2 "$R1\*.*"
212 IfFileExists "$R1\$R2\*.*" 0 Next
215 #Goto Exit ;uncomment this to stop it being recursive
232 Function un
.RmFilesButOne
233 Exch $R0 ; exclude file
239 FindFirst $R3 $R2 "$R1\*.*"
246 IfFileExists "$R1\$R2\*.*" Next
249 #Goto Exit ;uncomment this to stop it being recursive