~unifield-team/unifield-web/us-2156

« back to all changes in this revision

Viewing changes to setup.nsi

  • Committer: Stephane Wirtel
  • Date: 2010-12-29 11:24:04 UTC
  • Revision ID: stephane@openerp.com-20101229112404-l6c0eenec52gnr0y
[IMP] Change the Win32 Installer

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
4
 
#
5
 
# WARNING: This program as such is intended to be used by professional
6
 
# programmers who take the whole responsability of assessing all potential
7
 
# consequences resulting from its eventual inadequacies and bugs
8
 
# End users who are looking for a ready-to-use solution with commercial
9
 
# garantees and support are strongly adviced to contract a Free Software
10
 
# Service Company
11
 
#
12
 
# This program is Free Software; you can redistribute it and/or
13
 
# modify it under the terms of the GNU General Public License
14
 
# as published by the Free Software Foundation; either version 3
15
 
# of the License, or (at your option) any later version.
16
 
#
17
 
# This program is distributed in the hope that it will be useful,
18
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
# GNU General Public License for more details.
21
 
#
22
 
# You should have received a copy of the GNU General Public License
23
 
# along with this program; if not, write to the Free Software
24
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
 
###############################################################################
26
 
!ifndef VERSION
27
 
    !error "Do not forget to specify the version of OpenERP - /DVERSION=<VERSION>"
28
 
!endif 
29
 
 
30
 
!include "MUI.nsh"
31
 
 
32
 
;--------------------------------
33
 
;General
34
 
 
35
 
;Name and file
36
 
Name "OpenERP Web"
37
 
OutFile "openerp-web-setup-${VERSION}.exe"
38
 
SetCompressor lzma
39
 
SetCompress auto
40
 
 
41
 
;Default installation folder
42
 
InstallDir "$PROGRAMFILES\OpenERP Web"
43
 
 
44
 
;Get installation folder from registry if available
45
 
InstallDirRegKey HKLM "Software\OpenERP Web" ""
46
 
 
47
 
BrandingText "OpenERP Web ${VERSION}"
48
 
 
49
 
;Vista redirects $SMPROGRAMS to all users without this
50
 
RequestExecutionLevel admin
51
 
 
52
 
;--------------------------------
53
 
;Variables
54
 
 
55
 
Var MUI_TEMP
56
 
Var STARTMENU_FOLDER
57
 
 
58
 
;--------------------------------
59
 
;Interface Settings
60
 
 
61
 
!define MUI_ABORTWARNING
62
 
 
63
 
!define REGKEY "SOFTWARE\$(^Name)"
64
 
!define MUI_LANGDLL_REGISTRY_ROOT HKLM
65
 
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
66
 
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
67
 
 
68
 
!insertmacro MUI_RESERVEFILE_LANGDLL
69
 
;--------------------------------
70
 
;Pages
71
 
 
72
 
!define MUI_ICON ".\pixmaps\openerp-icon.ico"
73
 
!define MUI_WELCOMEFINISHPAGE_BITMAP ".\pixmaps\openerp-intro.bmp"
74
 
!define MUI_UNWELCOMEFINISHPAGE_BITMAP ".\pixmaps\openerp-intro.bmp"
75
 
!define MUI_HEADERIMAGE
76
 
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
77
 
!define MUI_HEADER_TRANSPARENT_TEXT ""
78
 
!define MUI_HEADERIMAGE_BITMAP ".\pixmaps\openerp-slogan.bmp"
79
 
!define MUI_LICENSEPAGE_TEXT_BOTTOM "$(LicenseText)"
80
 
!define MUI_LICENSEPAGE_BUTTON "$(LicenseNext)"
81
 
 
82
 
!insertmacro MUI_PAGE_WELCOME
83
 
!insertmacro MUI_PAGE_LICENSE ".\doc\LICENSE.TXT"
84
 
!insertmacro MUI_PAGE_DIRECTORY
85
 
 
86
 
;Start Menu Folder Page Configuration
87
 
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" 
88
 
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenERP Web"
89
 
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "OpenERP Web"
90
 
 
91
 
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
92
 
 
93
 
!insertmacro MUI_PAGE_INSTFILES
94
 
 
95
 
!define MUI_FINISHPAGE_NOAUTOCLOSE
96
 
!define MUI_FINISHPAGE_RUN
97
 
!define MUI_FINISHPAGE_RUN_CHECKED
98
 
!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageText)" 
99
 
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
100
 
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
101
 
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
102
 
!insertmacro MUI_PAGE_FINISH
103
 
 
104
 
 
105
 
!insertmacro MUI_UNPAGE_WELCOME
106
 
!insertmacro MUI_UNPAGE_CONFIRM
107
 
!insertmacro MUI_UNPAGE_INSTFILES
108
 
 
109
 
;--------------------------------
110
 
;Languages
111
 
 
112
 
!insertmacro MUI_LANGUAGE "English"
113
 
!insertmacro MUI_LANGUAGE "French"
114
 
 
115
 
!macro CreateInternetShortcut FILENAME URL
116
 
        WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
117
 
!macroend
118
 
 
119
 
;--------------------------------
120
 
;Installer Sections
121
 
Function .onInit 
122
 
!ifndef ALLINONE
123
 
    ;Language selection dialog
124
 
    Push ""
125
 
    Push ${LANG_ENGLISH}
126
 
    Push English
127
 
    Push ${LANG_FRENCH}
128
 
    Push French
129
 
    Push A ; A means auto count languages
130
 
    ; for the auto count to work the first empty push (Push "") must remain
131
 
    LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
132
 
 
133
 
    Pop $LANGUAGE
134
 
    StrCmp $LANGUAGE "cancel" 0 +2
135
 
        Abort
136
 
!endif
137
 
 
138
 
    ClearErrors
139
 
    ReadRegStr $0 HKLM "Software\OpenERP Web" ""
140
 
    IfErrors DoInstall 0
141
 
        MessageBox MB_OK "$(CannotInstallWebText)"
142
 
        Quit
143
 
    DoInstall:
144
 
FunctionEnd
145
 
 
146
 
Section "OpenERP Web" SecOpenERPWeb
147
 
    nsExec::Exec "net stop openerp-web"
148
 
    sleep 2
149
 
 
150
 
    SetOutPath "$INSTDIR"
151
 
 
152
 
    ;ADD YOUR OWN FILES HERE...
153
 
    File /r "dist\*"
154
 
 
155
 
    SetOutPath "$INSTDIR\service"
156
 
    File /r "win32\dist\*"
157
 
    File "win32\start.bat"
158
 
    File "win32\stop.bat"
159
 
 
160
 
    SetOutPath "$INSTDIR\conf"
161
 
    File "/oname=openerp-web.cfg" ".\doc\openerp-web.cfg"
162
 
 
163
 
    ;Store installation folder
164
 
    WriteRegStr HKLM "Software\OpenERP Web" "" $INSTDIR
165
 
 
166
 
!ifndef ALLINONE
167
 
    ;Create uninstaller
168
 
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Web" "DisplayName" "OpenERP Web ${VERSION}"
169
 
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Web" "UninstallString" "$INSTDIR\Uninstall.exe"
170
 
!else
171
 
    WriteRegStr HKLM  "Software\OpenERP AllInOne" "UninstallWeb" "$INSTDIR\Uninstall.exe"
172
 
!endif
173
 
    WriteUninstaller "$INSTDIR\Uninstall.exe"
174
 
 
175
 
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
176
 
        ;Create shortcuts
177
 
        CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
178
 
        
179
 
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start OpenERP Web.lnk" "$INSTDIR\service\start.bat"
180
 
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop OpenERP Web.lnk" "$INSTDIR\service\stop.bat"
181
 
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit Web Config.lnk" "notepad.exe" "$INSTDIR\conf\openerp-web.cfg"
182
 
!ifndef ALLINONE
183
 
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\uninstall.exe"
184
 
!endif
185
 
        !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Forum" "http://www.openerp.com/forum"
186
 
        !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Translation" "https://translations.launchpad.net/openobject"
187
 
    !insertmacro MUI_STARTMENU_WRITE_END
188
 
 
189
 
 
190
 
    nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -auto -install'
191
 
 
192
 
SectionEnd
193
 
 
194
 
;Descriptions
195
 
 
196
 
 
197
 
;--------------------------------
198
 
;Uninstaller Section
199
 
 
200
 
Section "Uninstall"
201
 
    nsExec::Exec "net stop openerp-web"
202
 
    sleep 2
203
 
    nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -remove'
204
 
    sleep 2
205
 
 
206
 
    RMDIR /r "$INSTDIR" 
207
 
    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
208
 
 
209
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Forum.url"
210
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Translation.url"
211
 
!ifndef ALLINONE
212
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
213
 
!endif 
214
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
215
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Start OpenERP Web.lnk"
216
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Stop OpenERP Web.lnk"
217
 
    Delete "$SMPROGRAMS\$MUI_TEMP\Edit Web Config.lnk"
218
 
 
219
 
    ;Delete empty start menu parent diretories
220
 
    StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
221
 
 
222
 
    startMenuDeleteLoop:
223
 
        ClearErrors
224
 
        RMDir $MUI_TEMP
225
 
        GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
226
 
 
227
 
        IfErrors startMenuDeleteLoopDone
228
 
 
229
 
        StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
230
 
 
231
 
    startMenuDeleteLoopDone:
232
 
 
233
 
!ifndef ALLINONE
234
 
        DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Web"
235
 
!else 
236
 
        DeleteRegKey HKLM "Software\OpenERP AllInOne\UninstallWeb"
237
 
!endif
238
 
        DeleteRegKey /ifempty HKLM "Software\OpenERP Web"
239
 
 
240
 
SectionEnd
241
 
 
242
 
Function LaunchLink
243
 
    nsExec::Exec "net start openerp-web"
244
 
FunctionEnd
245
 
 
246
 
LangString LicenseText ${LANG_ENGLISH} "Usually, a proprietary license is provided with the software: limited number of users, limited in time usage, etc. This Open Source license is the opposite: it garantees you the right to use, copy, study, distribute and modify Open ERP for free."
247
 
LangString LicenseText ${LANG_FRENCH} "Normalement, une licence propri�taire est fournie avec le logiciel: limitation du nombre d'utilisateurs, limitation dans le temps, etc. Cette licence Open Source est l'oppos�: Elle vous garantie le droit d'utiliser, de copier, d'�tudier, de distribuer et de modifier Open ERP librement."
248
 
 
249
 
LangString LicenseNext ${LANG_ENGLISH} "Next >"
250
 
LangString LicenseNext ${LANG_FRENCH} "Suivant >"
251
 
 
252
 
LangString FinishPageText ${LANG_ENGLISH} "Start OpenERP Web"
253
 
LangString FinishPageText ${LANG_FRENCH} "Lancer le serveur Web OpenERP"
254
 
 
255
 
;Language strings
256
 
LangString DESC_SecOpenERPWeb ${LANG_ENGLISH} "OpenERP Web."
257
 
LangString DESC_SecOpenERPWeb ${LANG_FRENCH} "Serveur Web OpenERP."
258
 
 
259
 
LangString CannotInstallWebText ${LANG_ENGLISH} "Can not install the OpenERP Web because a previous installation already exists on this system. Please uninstall your current installation and relaunch this setup wizard."
260
 
LangString CannotInstallWebText ${LANG_FRENCH} "Ne peut pas installer le serveur Web Open ERP parce qu'une installation existe d�j�sur ce syst�me. S'il vous plait, d�sinstallez votre installation actuelle et relancer l'installeur."
261
 
 
262
 
 
263
 
;Assign language strings to sections
264
 
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
265
 
    !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenERPWeb} $(DESC_SecOpenERPWeb)
266
 
!insertmacro MUI_FUNCTION_DESCRIPTION_END
267
 
 
 
1
#####################################################################################
 
2
#
 
3
# Copyright (c) 2004-TODAY OpenERP S.A. (http://www.openerp.com) All Rights Reserved.
 
4
#
 
5
# WARNING: This program as such is intended to be used by professional
 
6
# programmers who take the whole responsability of assessing all potential
 
7
# consequences resulting from its eventual inadequacies and bugs
 
8
# End users who are looking for a ready-to-use solution with commercial
 
9
# garantees and support are strongly adviced to contract a Free Software
 
10
# Service Company
 
11
#
 
12
# This program is Free Software; you can redistribute it and/or
 
13
# modify it under the terms of the GNU General Public License
 
14
# as published by the Free Software Foundation; either version 3
 
15
# of the License, or (at your option) any later version.
 
16
#
 
17
# This program is distributed in the hope that it will be useful,
 
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
# GNU General Public License for more details.
 
21
#
 
22
# You should have received a copy of the GNU General Public License
 
23
# along with this program; if not, write to the Free Software
 
24
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
25
#####################################################################################
 
26
 
 
27
!include 'MUI2.nsh'
 
28
!include 'FileFunc.nsh'
 
29
!include 'LogicLib.nsh'
 
30
!include 'Sections.nsh'
 
31
 
 
32
!define PUBLISHER 'OpenERP S.A.'
 
33
!define MAJOR_VERSION '6.0'
 
34
!define MINOR_VERSION '0.0'
 
35
!define REVISION_VERSION 'RC2-test'
 
36
!ifndef REVISION_VERSION
 
37
    !define VERSION "${MAJOR_VERSION}.${MINOR_VERSION}"
 
38
!else
 
39
    !define VERSION "${MAJOR_VERSION}.${MINOR_VERSION}-${REVISION_VERSION}"
 
40
!endif
 
41
!define PRODUCT_NAME "OpenERP Web Client"
 
42
!define DISPLAY_NAME "${PRODUCT_NAME} ${MAJOR_VERSION}"
 
43
 
 
44
!define UNINSTALL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${DISPLAY_NAME}"
 
45
 
 
46
!define REGISTRY_KEY "Software\${DISPLAY_NAME}"
 
47
 
 
48
Name '${DISPLAY_NAME}'
 
49
Caption "${PRODUCT_NAME} ${VERSION} Setup"
 
50
OutFile "openerp-web-setup-${VERSION}.exe"
 
51
SetCompressor /final /solid lzma
 
52
SetCompress auto
 
53
ShowInstDetails show
 
54
 
 
55
XPStyle on
 
56
 
 
57
InstallDir "$PROGRAMFILES\OpenERP ${MAJOR_VERSION}\Web"
 
58
InstallDirRegKey HKCU "${REGISTRY_KEY}" ""
 
59
 
 
60
BrandingText '${PRODUCT_NAME} ${VERSION}'
 
61
 
 
62
RequestExecutionLevel admin
 
63
 
 
64
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
 
65
VIAddVersionKey "CompanyName" "${PUBLISHER}"
 
66
VIAddVersionKey "FileDescription" "Installer of ${DISPLAY_NAME}" 
 
67
VIAddVersionKey "LegalCopyright" "${PUBLISHER}"
 
68
VIAddVersionKey "LegalTrademark" "OpenERP is a trademark of ${PUBLISHER}"
 
69
VIAddVersionKey "FileVersion" "${MAJOR_VERSION}"
 
70
VIProductVersion "${VERSION}"
 
71
 
 
72
!insertmacro GetParameters
 
73
!insertmacro GetOptions
 
74
 
 
75
Var Option_AllInOne
 
76
Var cmdLineParams
 
77
 
 
78
Var MUI_TEMP
 
79
Var STARTMENU_FOLDER
 
80
 
 
81
!define MUI_ABORTWARNING
 
82
!define MUI_ICON ".\pixmaps\openerp-icon.ico"
 
83
 
 
84
!define MUI_WELCOMEFINISHPAGE_BITMAP ".\pixmaps\openerp-intro.bmp"
 
85
!define MUI_UNWELCOMEFINISHPAGE_BITMAP ".\pixmaps\openerp-intro.bmp"
 
86
!define MUI_HEADERIMAGE
 
87
!define MUI_HEADERIMAGE_BITMAP ".\pixmaps\openerp-slogan.bmp"
 
88
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
 
89
!define MUI_HEADER_TRANSPARENT_TEXT ""
 
90
 
 
91
!insertmacro MUI_PAGE_WELCOME
 
92
!insertmacro MUI_PAGE_LICENSE "doc\License.txt"
 
93
!insertmacro MUI_PAGE_DIRECTORY
 
94
 
 
95
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" 
 
96
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGISTRY_KEY}"
 
97
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${DISPLAY_NAME}"
 
98
 
 
99
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
 
100
!insertmacro MUI_PAGE_INSTFILES
 
101
 
 
102
!define MUI_FINISHPAGE_NOAUTOCLOSE
 
103
!define MUI_FINISHPAGE_LINK $(DESC_FinishPage_Link) 
 
104
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.openerp.com/contact"
 
105
!insertmacro MUI_PAGE_FINISH
 
106
 
 
107
!insertmacro MUI_UNPAGE_WELCOME
 
108
!insertmacro MUI_UNPAGE_CONFIRM
 
109
!insertmacro MUI_UNPAGE_INSTFILES
 
110
!insertmacro MUI_UNPAGE_FINISH
 
111
 
 
112
!insertmacro MUI_LANGUAGE "English"
 
113
!insertmacro MUI_LANGUAGE "French"
 
114
!insertmacro MUI_RESERVEFILE_LANGDLL
 
115
 
 
116
!macro CreateInternetShortcut FILENAME URL
 
117
        WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
 
118
!macroend
 
119
 
 
120
; English
 
121
LangString DESC_FinishPage_Link ${LANG_ENGLISH} "Contact OpenERP for Partnership and/or Support"
 
122
 
 
123
 
 
124
; French
 
125
LangString DESC_FinishPage_Link ${LANG_FRENCH} "Contactez OpenERP pour un Partenariat et/ou du Support"
 
126
 
 
127
Section -StopService
 
128
    nsExec::Exec "net stop openerp-web-6.0"
 
129
    sleep 2
 
130
SectionEnd
 
131
 
 
132
Section OpenERP_Web_Client SectionOpenERP_Web_Client
 
133
    SetOutPath '$INSTDIR'
 
134
 
 
135
    File /r "dist\*"
 
136
 
 
137
    SetOutPath '$INSTDIR\service'
 
138
    File /r "win32\dist\*"
 
139
    File "win32\start.bat"
 
140
    File "win32\stop.bat"
 
141
 
 
142
    SetOutPath "$INSTDIR\conf"
 
143
    File "/oname=openerp-web.cfg" ".\doc\openerp-web.cfg"
 
144
 
 
145
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
146
        ;Create shortcuts
 
147
        CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
 
148
        
 
149
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start OpenERP Web.lnk" "$INSTDIR\service\start.bat"
 
150
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop OpenERP Web.lnk" "$INSTDIR\service\stop.bat"
 
151
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit Web Config.lnk" "notepad.exe" "$INSTDIR\conf\openerp-web.cfg"
 
152
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\uninstall.exe"
 
153
        !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Forum" "http://www.openerp.com/forum"
 
154
        !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Translation" "https://translations.launchpad.net/openobject"
 
155
    !insertmacro MUI_STARTMENU_WRITE_END
 
156
SectionEnd
 
157
 
 
158
Section -RestartService
 
159
    nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -auto -install'
 
160
    sleep 2
 
161
    nsExec::Exec "net start openerp-web-6.0"
 
162
    sleep 2
 
163
SectionEnd
 
164
 
 
165
Section -Post
 
166
    WriteRegExpandStr HKLM "${UNINSTALL_REGISTRY_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
 
167
    WriteRegExpandStr HKLM "${UNINSTALL_REGISTRY_KEY}" "InstallLocation" "$INSTDIR"
 
168
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "DisplayName" "${DISPLAY_NAME}"
 
169
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "DisplayVersion" "${MAJOR_VERSION}"
 
170
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "Publisher" "${PUBLISHER}"
 
171
    WriteRegDWORD HKLM     "${UNINSTALL_REGISTRY_KEY}" "Version" "${VERSION}"
 
172
    WriteRegDWORD HKLM     "${UNINSTALL_REGISTRY_KEY}" "VersionMajor" "${MAJOR_VERSION}"
 
173
    WriteRegDWORD HKLM     "${UNINSTALL_REGISTRY_KEY}" "VersionMinor" "${MINOR_VERSION}"
 
174
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "HelpLink" "support@openerp.com"
 
175
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "HelpTelephone" "+32.81.81.37.00"
 
176
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "URLInfoAbout" "http://www.openerp.com"
 
177
    WriteRegStr HKLM       "${UNINSTALL_REGISTRY_KEY}" "Contact" "sales@openerp.com"
 
178
    WriteRegDWORD HKLM     "${UNINSTALL_REGISTRY_KEY}" "NoModify" "1"
 
179
    WriteRegDWORD HKLM     "${UNINSTALL_REGISTRY_KEY}" "NoRepair" "1"
 
180
    WriteUninstaller "$INSTDIR\Uninstall.exe"
 
181
SectionEnd
 
182
 
 
183
Section "Uninstall"
 
184
    nsExec::Exec "net stop openerp-web-6.0"
 
185
    sleep 2
 
186
    nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -remove'
 
187
    sleep 2
 
188
 
 
189
    Rmdir /r "$INSTDIR"
 
190
 
 
191
 
 
192
    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
 
193
    Delete "$SMPROGRAMS\$MUI_TEMP\Forum.url"
 
194
    Delete "$SMPROGRAMS\$MUI_TEMP\Translation.url"
 
195
    Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
 
196
    Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
 
197
    Delete "$SMPROGRAMS\$MUI_TEMP\Start OpenERP Web.lnk"
 
198
    Delete "$SMPROGRAMS\$MUI_TEMP\Stop OpenERP Web.lnk"
 
199
    Delete "$SMPROGRAMS\$MUI_TEMP\Edit Web Config.lnk"
 
200
 
 
201
    ;Delete empty start menu parent diretories
 
202
    StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
 
203
 
 
204
    startMenuDeleteLoop:
 
205
        ClearErrors
 
206
        RMDir $MUI_TEMP
 
207
        GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
 
208
 
 
209
        IfErrors startMenuDeleteLoopDone
 
210
 
 
211
        StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
 
212
 
 
213
    startMenuDeleteLoopDone:
 
214
 
 
215
    DeleteRegKey HKLM "${UNINSTALL_REGISTRY_KEY}"
 
216
 
 
217
SectionEnd
 
218
 
 
219
Function .onInit
 
220
    Push $R0
 
221
 
 
222
    ${GetParameters} $cmdLineParams
 
223
    ClearErrors
 
224
 
 
225
    Pop $R0
 
226
 
 
227
    StrCpy $Option_AllInOne 0
 
228
 
 
229
    Push $R0
 
230
    ${GetOptions} $cmdLineParams '/allinone' $R0
 
231
    IfErrors +2 0
 
232
    StrCpy $Option_AllInOne 1
 
233
    Pop $R0
 
234
 
 
235
    StrCmp $Option_AllInOne 1 AllInOneMode
 
236
    StrCmp $Option_AllInOne 0 NoAllInOneMode
 
237
 
 
238
    AllInOneMode:
 
239
        MessageBox MB_OK|MB_ICONINFORMATION "All In One"
 
240
 
 
241
    NoAllInOneMode:
 
242
    
 
243
    !insertmacro MUI_LANGDLL_DISPLAY
 
244
 
 
245
FunctionEnd