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
;--------------------------------
36
Name "OpenERP Web Client"
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\python24"
152
;ADD YOUR OWN FILES HERE...
153
File /r /x "*.pyc" /x "*.pyo" /x "*.msi" /x "*~" "build\python24\*"
155
SetOutPath "$INSTDIR\bin"
158
File "OpenERPWebService.py"
160
SetOutPath "$INSTDIR\conf"
161
File "/oname=openerp-web.cfg" "..\config\default.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"
178
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start Web Client.lnk" "$INSTDIR\bin\start.bat"
179
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop Web Client.lnk" "$INSTDIR\bin\stop.bat"
180
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit Web Config.lnk" "notepad.exe" "$INSTDIR\conf\openerp-web.cfg"
182
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\uninstall.exe"
184
!insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Forum" "http://www.openerp.com/forum"
185
!insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Translation" "https://translations.launchpad.net/openobject"
186
!insertmacro MUI_STARTMENU_WRITE_END
188
nsExec::Exec '"$INSTDIR\python24\python.exe" "$INSTDIR\python24\Scripts\fixps.py"'
189
nsExec::Exec '"$INSTDIR\python24\python.exe" "$INSTDIR\bin\OpenERPWebService.py" install'
196
;--------------------------------
200
nsExec::Exec "net stop openerp-web"
202
nsExec::Exec '"$INSTDIR\python24\python.exe" "$INSTDIR\bin\OpenERPWebService.py" remove'
206
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
208
Delete "$SMPROGRAMS\$MUI_TEMP\Forum.url"
209
Delete "$SMPROGRAMS\$MUI_TEMP\Translation.url"
211
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
213
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
214
Delete "$SMPROGRAMS\$MUI_TEMP\Start Web Client.lnk"
215
Delete "$SMPROGRAMS\$MUI_TEMP\Stop Web Client.lnk"
216
Delete "$SMPROGRAMS\$MUI_TEMP\Edit Web Config.lnk"
218
;Delete empty start menu parent diretories
219
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
224
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
226
IfErrors startMenuDeleteLoopDone
228
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
230
startMenuDeleteLoopDone:
233
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Web"
235
DeleteRegKey HKLM "Software\OpenERP AllInOne\UninstallWeb"
237
DeleteRegKey /ifempty HKLM "Software\OpenERP Web"
242
nsExec::Exec "net start openerp-web"
245
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."
246
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
LangString LicenseNext ${LANG_ENGLISH} "Next >"
249
LangString LicenseNext ${LANG_FRENCH} "Suivant >"
251
LangString FinishPageText ${LANG_ENGLISH} "Start OpenERP Web Client"
252
LangString FinishPageText ${LANG_FRENCH} "Lancer le serveur OpenERP"
255
LangString DESC_SecOpenERPWeb ${LANG_ENGLISH} "OpenERP Web Client."
256
LangString DESC_SecOpenERPWeb ${LANG_FRENCH} "Serveur OpenERP."
258
LangString CannotInstallWebText ${LANG_ENGLISH} "Can not install the OpenERP Web Client because a previous installation already exists on this system. Please uninstall your current installation and relaunch this setup wizard."
259
LangString CannotInstallWebText ${LANG_FRENCH} "Ne peut pas installer le serveur 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."
262
;Assign language strings to sections
263
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
264
!insertmacro MUI_DESCRIPTION_TEXT ${SecOpenERPWeb} $(DESC_SecOpenERPWeb)
265
!insertmacro MUI_FUNCTION_DESCRIPTION_END