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-server-setup-${VERSION}.exe"
41 ;Default installation folder
42 InstallDir "$PROGRAMFILES\OpenERP Server"
44 ;Get installation folder from registry if available
45 InstallDirRegKey HKLM "Software\OpenERP Server" ""
47 BrandingText "OpenERP Server ${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.rtf"
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 Server"
89 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "OpenERP Server"
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 Server" ""
141 MessageBox MB_OK "$(CannotInstallServerText)"
146 Section "OpenERP Server" SecOpenERPServer
147 nsExec::Exec "net stop openerp-service"
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 ;Store installation folder
161 WriteRegStr HKLM "Software\OpenERP Server" "" $INSTDIR
165 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Server" "DisplayName" "OpenERP Server ${VERSION}"
166 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenERP Server" "UninstallString" "$INSTDIR\Uninstall.exe"
168 WriteRegStr HKLM "Software\OpenERP AllInOne" "UninstallServer" "$INSTDIR\Uninstall.exe"
170 WriteUninstaller "$INSTDIR\Uninstall.exe"
172 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
174 CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
175 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenERP Server.lnk" "$INSTDIR\openerp-server.exe"
176 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start service.lnk" "$INSTDIR\service\start.bat"
177 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop service.lnk" "$INSTDIR\service\stop.bat"
178 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Edit config.lnk" "notepad.exe" "$INSTDIR\openerp-server.conf"
179 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\View log.lnk" "notepad.exe" "$INSTDIR\openerp-server.log"
181 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\uninstall.exe"
183 !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Forum" "http://www.openerp.com/forum"
184 !insertmacro CreateInternetShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\Translation" "https://translations.launchpad.net/openobject"
185 !insertmacro MUI_STARTMENU_WRITE_END
187 nsExec::Exec '"$INSTDIR\openerp-server.exe" --stop-after-init --logfile "$INSTDIR\openerp-server.log" -s'
188 nsExec::Exec '"$INSTDIR\service\OpenERPServerService.exe" -auto -install'
195 ;--------------------------------
199 nsExec::Exec "net stop openerp-service"
201 nsExec::Exec '"$INSTDIR\service\OpenERPServerService.exe" -remove'
205 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
207 Delete "$SMPROGRAMS\$MUI_TEMP\Forum.url"
208 Delete "$SMPROGRAMS\$MUI_TEMP\Translation.url"
210 Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
212 Delete "$SMPROGRAMS\$MUI_TEMP\OpenERP Server.lnk"
213 Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
214 Delete "$SMPROGRAMS\$MUI_TEMP\Start service.lnk"
215 Delete "$SMPROGRAMS\$MUI_TEMP\Stop service.lnk"
216 Delete "$SMPROGRAMS\$MUI_TEMP\Edit config.lnk"
217 Delete "$SMPROGRAMS\$MUI_TEMP\View log.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 Server"
236 DeleteRegKey HKLM "Software\OpenERP AllInOne\UninstallServer"
238 DeleteRegKey /ifempty HKLM "Software\OpenERP Server"
243 nsExec::Exec "net start openerp-service"
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 Server"
253 LangString FinishPageText ${LANG_FRENCH} "Lancer le serveur OpenERP"
256 LangString DESC_SecOpenERPServer ${LANG_ENGLISH} "OpenERP Server."
257 LangString DESC_SecOpenERPServer ${LANG_FRENCH} "Serveur OpenERP."
259 LangString CannotInstallServerText ${LANG_ENGLISH} "Can not install the Open ERP Server because a previous installation already exists on this system. Please uninstall your current installation and relaunch this setup wizard."
260 LangString CannotInstallServerText ${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."
263 ;Assign language strings to sections
264 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
265 !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenERPServer} $(DESC_SecOpenERPServer)
266 !insertmacro MUI_FUNCTION_DESCRIPTION_END