1
##############################################################################
3
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
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
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.
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.
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
###############################################################################
27
!error "Do not forget to specify the version of OpenERP - /DVERSION=<VERSION>"
32
;--------------------------------
37
OutFile "openerp-web-setup-${VERSION}.exe"
41
;Default installation folder
42
InstallDir "$PROGRAMFILES\OpenERP Web"
44
;Get installation folder from registry if available
45
InstallDirRegKey HKLM "Software\OpenERP Web" ""
47
BrandingText "OpenERP Web ${VERSION}"
49
;Vista redirects $SMPROGRAMS to all users without this
50
RequestExecutionLevel admin
52
;--------------------------------
58
;--------------------------------
61
!define MUI_ABORTWARNING
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
68
!insertmacro MUI_RESERVEFILE_LANGDLL
69
;--------------------------------
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)"
82
!insertmacro MUI_PAGE_WELCOME
83
!insertmacro MUI_PAGE_LICENSE ".\doc\LICENSE.TXT"
84
!insertmacro MUI_PAGE_DIRECTORY
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"
91
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
93
!insertmacro MUI_PAGE_INSTFILES
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
105
!insertmacro MUI_UNPAGE_WELCOME
106
!insertmacro MUI_UNPAGE_CONFIRM
107
!insertmacro MUI_UNPAGE_INSTFILES
109
;--------------------------------
112
!insertmacro MUI_LANGUAGE "English"
113
!insertmacro MUI_LANGUAGE "French"
115
!macro CreateInternetShortcut FILENAME URL
116
WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
119
;--------------------------------
123
;Language selection dialog
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"
134
StrCmp $LANGUAGE "cancel" 0 +2
139
ReadRegStr $0 HKLM "Software\OpenERP Web" ""
141
MessageBox MB_OK "$(CannotInstallWebText)"
146
Section "OpenERP Web" SecOpenERPWeb
147
nsExec::Exec "net stop openerp-web"
150
SetOutPath "$INSTDIR"
152
;ADD YOUR OWN FILES HERE...
155
SetOutPath "$INSTDIR\service"
156
File /r "win32\dist\*"
157
File "win32\start.bat"
158
File "win32\stop.bat"
160
SetOutPath "$INSTDIR\conf"
161
File "/oname=openerp-web.cfg" ".\doc\openerp-web.cfg"
163
;Store installation folder
164
WriteRegStr HKLM "Software\OpenERP Web" "" $INSTDIR
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"
171
WriteRegStr HKLM "Software\OpenERP AllInOne" "UninstallWeb" "$INSTDIR\Uninstall.exe"
173
WriteUninstaller "$INSTDIR\Uninstall.exe"
175
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
177
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
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"
183
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\uninstall.exe"
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
190
nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -auto -install'
197
;--------------------------------
201
nsExec::Exec "net stop openerp-web"
203
nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -remove'
207
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
209
Delete "$SMPROGRAMS\$MUI_TEMP\Forum.url"
210
Delete "$SMPROGRAMS\$MUI_TEMP\Translation.url"
212
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
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"
219
;Delete empty start menu parent diretories
220
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
225
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
227
IfErrors startMenuDeleteLoopDone
229
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
231
startMenuDeleteLoopDone:
234
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Web"
236
DeleteRegKey HKLM "Software\OpenERP AllInOne\UninstallWeb"
238
DeleteRegKey /ifempty HKLM "Software\OpenERP Web"
243
nsExec::Exec "net start openerp-web"
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."
249
LangString LicenseNext ${LANG_ENGLISH} "Next >"
250
LangString LicenseNext ${LANG_FRENCH} "Suivant >"
252
LangString FinishPageText ${LANG_ENGLISH} "Start OpenERP Web"
253
LangString FinishPageText ${LANG_FRENCH} "Lancer le serveur Web OpenERP"
256
LangString DESC_SecOpenERPWeb ${LANG_ENGLISH} "OpenERP Web."
257
LangString DESC_SecOpenERPWeb ${LANG_FRENCH} "Serveur Web OpenERP."
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."
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
1
#####################################################################################
3
# Copyright (c) 2004-TODAY OpenERP S.A. (http://www.openerp.com) All Rights Reserved.
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
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.
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.
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
#####################################################################################
28
!include 'FileFunc.nsh'
29
!include 'LogicLib.nsh'
30
!include 'Sections.nsh'
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}"
39
!define VERSION "${MAJOR_VERSION}.${MINOR_VERSION}-${REVISION_VERSION}"
41
!define PRODUCT_NAME "OpenERP Web Client"
42
!define DISPLAY_NAME "${PRODUCT_NAME} ${MAJOR_VERSION}"
44
!define UNINSTALL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${DISPLAY_NAME}"
46
!define REGISTRY_KEY "Software\${DISPLAY_NAME}"
48
Name '${DISPLAY_NAME}'
49
Caption "${PRODUCT_NAME} ${VERSION} Setup"
50
OutFile "openerp-web-setup-${VERSION}.exe"
51
SetCompressor /final /solid lzma
57
InstallDir "$PROGRAMFILES\OpenERP ${MAJOR_VERSION}\Web"
58
InstallDirRegKey HKCU "${REGISTRY_KEY}" ""
60
BrandingText '${PRODUCT_NAME} ${VERSION}'
62
RequestExecutionLevel admin
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}"
72
!insertmacro GetParameters
73
!insertmacro GetOptions
81
!define MUI_ABORTWARNING
82
!define MUI_ICON ".\pixmaps\openerp-icon.ico"
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 ""
91
!insertmacro MUI_PAGE_WELCOME
92
!insertmacro MUI_PAGE_LICENSE "doc\License.txt"
93
!insertmacro MUI_PAGE_DIRECTORY
95
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
96
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGISTRY_KEY}"
97
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${DISPLAY_NAME}"
99
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
100
!insertmacro MUI_PAGE_INSTFILES
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
107
!insertmacro MUI_UNPAGE_WELCOME
108
!insertmacro MUI_UNPAGE_CONFIRM
109
!insertmacro MUI_UNPAGE_INSTFILES
110
!insertmacro MUI_UNPAGE_FINISH
112
!insertmacro MUI_LANGUAGE "English"
113
!insertmacro MUI_LANGUAGE "French"
114
!insertmacro MUI_RESERVEFILE_LANGDLL
116
!macro CreateInternetShortcut FILENAME URL
117
WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
121
LangString DESC_FinishPage_Link ${LANG_ENGLISH} "Contact OpenERP for Partnership and/or Support"
125
LangString DESC_FinishPage_Link ${LANG_FRENCH} "Contactez OpenERP pour un Partenariat et/ou du Support"
128
nsExec::Exec "net stop openerp-web-6.0"
132
Section OpenERP_Web_Client SectionOpenERP_Web_Client
133
SetOutPath '$INSTDIR'
137
SetOutPath '$INSTDIR\service'
138
File /r "win32\dist\*"
139
File "win32\start.bat"
140
File "win32\stop.bat"
142
SetOutPath "$INSTDIR\conf"
143
File "/oname=openerp-web.cfg" ".\doc\openerp-web.cfg"
145
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
147
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
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
158
Section -RestartService
159
nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -auto -install'
161
nsExec::Exec "net start openerp-web-6.0"
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"
184
nsExec::Exec "net stop openerp-web-6.0"
186
nsExec::Exec '"$INSTDIR\service\OpenERPWebService.exe" -remove'
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"
201
;Delete empty start menu parent diretories
202
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
207
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
209
IfErrors startMenuDeleteLoopDone
211
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
213
startMenuDeleteLoopDone:
215
DeleteRegKey HKLM "${UNINSTALL_REGISTRY_KEY}"
222
${GetParameters} $cmdLineParams
227
StrCpy $Option_AllInOne 0
230
${GetOptions} $cmdLineParams '/allinone' $R0
232
StrCpy $Option_AllInOne 1
235
StrCmp $Option_AllInOne 1 AllInOneMode
236
StrCmp $Option_AllInOne 0 NoAllInOneMode
239
MessageBox MB_OK|MB_ICONINFORMATION "All In One"
243
!insertmacro MUI_LANGDLL_DISPLAY