[IMP] packaging: update windows packaging
Up to Odoo 13.0, the windows setup is 32 bits and embeds an old
postgresql 9.5 32 bits version too.
With this commit, the postgresql server is no longer embedded in the
resulting setup file. Instead, if the user choose to install the
postgresql server, the 12.4 version is downloaded from the official site
(version 10.14 in the case of a 32 bits windows).
Also, the Python target achitecture is choosen based on the Windows
system on which Odoo is installed.
This imply changes on the KVM images used to build the installer:
- The Windows system on the KVM as to be 64 bits.
- A 32 bits WinPython version must be in `c:/odoobuild/WinPy32`
- A 64 bits WinPyhton version must be in `c:/odoobuild/WinPy64`
A little bit of cleaning also comes with this commit to get rid of the
old `openerp` references.
closes odoo/odoo#57727
X-original-commit: c47d7c67066ff15602b16f18c4c3acebfd3a2755
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
+12
-14
@@ -96,7 +96,6 @@ def publish(args, pub_type, extensions):
|
||||
|
||||
if os.path.islink(latest_abspath):
|
||||
os.unlink(latest_abspath)
|
||||
|
||||
os.symlink(release_abspath, latest_abspath)
|
||||
|
||||
return release_path
|
||||
@@ -388,17 +387,18 @@ class KVM(object):
|
||||
def start(self):
|
||||
kvm_cmd = [
|
||||
"kvm",
|
||||
"-cpu", "core2duo",
|
||||
"-cpu", "Skylake-Client,hypervisor=on,hle=off,rtm=off",
|
||||
"-smp", "2,sockets=2,cores=1,threads=1",
|
||||
"-net", "nic,model=rtl8139",
|
||||
"-net", "nic,model=e1000e,macaddr=52:54:00:d3:38:5e",
|
||||
"-net", "user,hostfwd=tcp:127.0.0.1:10022-:22,hostfwd=tcp:127.0.0.1:18069-:8069,hostfwd=tcp:127.0.0.1:15432-:5432",
|
||||
"-m", "1024",
|
||||
"-m", "2048",
|
||||
"-drive", "file=%s,snapshot=on" % self.image,
|
||||
"-nographic"
|
||||
"-nographic",
|
||||
"-serial", "none",
|
||||
]
|
||||
logging.info("Starting kvm: {}".format(" ".join(kvm_cmd)))
|
||||
self.kvm_proc = subprocess.Popen(kvm_cmd)
|
||||
time.sleep(50)
|
||||
time.sleep(60) # give some time to the VM to start, otherwise the SSH server may not be ready
|
||||
signal.alarm(2400)
|
||||
signal.signal(signal.SIGALRM, self.timeout)
|
||||
try:
|
||||
@@ -422,7 +422,7 @@ class KVM(object):
|
||||
def rsync(self, rsync_args, options=['--delete', '--exclude', '.git', '--exclude', '.tx', '--exclude', '__pycache__']):
|
||||
cmd = [
|
||||
'rsync',
|
||||
'-rt',
|
||||
'-a',
|
||||
'-e', 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022 -i %s' % self.ssh_key
|
||||
]
|
||||
cmd.extend(options)
|
||||
@@ -437,7 +437,7 @@ class KVMWinBuildExe(KVM):
|
||||
def run(self):
|
||||
logging.info('Start building Windows package')
|
||||
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.version'), 'w') as f:
|
||||
f.write("VERSION=%s\n" % VERSION.replace('~', '_').replace('+', ''))
|
||||
f.write("VERSION=%s.%s\n" % (VERSION.replace('~', '_').replace('+', ''), TSTAMP))
|
||||
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.python'), 'w') as f:
|
||||
f.write("PYTHON_VERSION=%s\n" % self.args.vm_winxp_python_version)
|
||||
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.servicename'), 'w') as f:
|
||||
@@ -456,11 +456,11 @@ class KVMWinBuildExe(KVM):
|
||||
class KVMWinTestExe(KVM):
|
||||
def run(self):
|
||||
logging.info('Start testing Windows package')
|
||||
setup_path = glob("%s/openerp-server-setup-*.exe" % self.args.build_dir)[0]
|
||||
setup_path = glob("%s/odoo_setup_*.exe" % self.args.build_dir)[0]
|
||||
setupfile = setup_path.split('/')[-1]
|
||||
setupversion = setupfile.split('openerp-server-setup-')[1].split('.exe')[0]
|
||||
setupversion = setupfile.split('odoo_setup_')[1].split('.exe')[0]
|
||||
|
||||
self.rsync(['"%s"' % setup_path, '%s@127.0.0.1:' % self.login])
|
||||
self.rsync(['%s' % setup_path, '%s@127.0.0.1:' % self.login])
|
||||
self.ssh("TEMP=/tmp ./%s /S" % setupfile)
|
||||
self.ssh('PGPASSWORD=openpgpwd /cygdrive/c/"Program Files"/"Odoo %s"/PostgreSQL/bin/createdb.exe -e -U openpg mycompany' % setupversion)
|
||||
self.ssh('netsh advfirewall set publicprofile state off')
|
||||
@@ -471,8 +471,6 @@ class KVMWinTestExe(KVM):
|
||||
|
||||
def build_exe(args):
|
||||
KVMWinBuildExe(args).start()
|
||||
shutil.copy(glob('%s/openerp*.exe' % args.build_dir)[0], '%s/odoo_%s.%s.exe' % (args.build_dir, VERSION, TSTAMP))
|
||||
|
||||
|
||||
def test_exe(args):
|
||||
if args.test:
|
||||
@@ -496,7 +494,7 @@ def parse_args():
|
||||
ap.add_argument("--vm-winxp-image", default='/home/odoo/vm/win1036/win10_winpy36.qcow2', help="%(default)s")
|
||||
ap.add_argument("--vm-winxp-ssh-key", default='/home/odoo/vm/win1036/id_rsa', help="%(default)s")
|
||||
ap.add_argument("--vm-winxp-login", default='Naresh', help="Windows login %(default)s")
|
||||
ap.add_argument("--vm-winxp-python-version", default='3.7.4', help="Windows Python version installed in the VM (default: %(default)s)")
|
||||
ap.add_argument("--vm-winxp-python-version", default='3.7.7', help="Windows Python version installed in the VM (default: %(default)s)")
|
||||
|
||||
ap.add_argument("-t", "--test", action="store_true", default=False, help="Test built packages")
|
||||
ap.add_argument("-s", "--sign", action="store_true", default=False, help="Sign Debian package / generate Rpm repo")
|
||||
|
||||
+16
-9
@@ -8,7 +8,8 @@ FILES_DIRECTORY=release
|
||||
MAKENSIS_ARGUMENTS=/DVERSION=$(VERSION) /DSERVICENAME=${SERVICENAME} /DPYTHONVERSION=${PYTHON_VERSION}
|
||||
|
||||
LAUNCH_MAKENSIS=/cygdrive/c/tools/cygwin/makensis $(MAKENSIS_ARGUMENTS) setup.nsi
|
||||
WINPY_DIR=/cygdrive/c/odoobuild/WinPython/python-${PYTHON_VERSION}
|
||||
WINPY32_DIR=/cygdrive/c/odoobuild/WinPy32/python-${PYTHON_VERSION}
|
||||
WINPY64_DIR=/cygdrive/c/odoobuild/WinPy64/python-${PYTHON_VERSION}.amd64
|
||||
|
||||
default: allinone
|
||||
|
||||
@@ -17,19 +18,25 @@ clean: server_clean
|
||||
rm -rf *.exe
|
||||
|
||||
server_clean:
|
||||
rm -rf $(SERVER_DIRECTORY)/dist
|
||||
rm -rf $(SERVER_DIRECTORY)/dist
|
||||
rm -rf $(SERVER_DIRECTORY)/build
|
||||
rm -rf $(SERVER_DIRECTORY)/win32/dist
|
||||
rm -rf $(SERVER_DIRECTORY)/win32/dist
|
||||
rm -rf $(SERVER_DIRECTORY)/win32/build
|
||||
rm -rf $(SERVER_DIRECTORY)/*.exe
|
||||
rm -rf $(SERVER_DIRECTORY)/.cyg*
|
||||
|
||||
allinone: server_clean
|
||||
cp $(SERVER_DIRECTORY)/requirements.txt $(WINPY_DIR)/
|
||||
-(cd $(WINPY_DIR) && ./python.exe -m pip install --upgrade pip)
|
||||
-(cd $(WINPY_DIR) && cat requirements.txt | while read PAC ; do Scripts/pip3.exe install "$${PAC}" ; done)
|
||||
-(cd $(WINPY_DIR) && Scripts/pip3.exe freeze)
|
||||
rm $(WINPY_DIR)/requirements.txt
|
||||
cp $(SERVER_DIRECTORY)/requirements.txt $(WINPY32_DIR)/
|
||||
-(cd $(WINPY32_DIR) && ./python.exe -m pip install --upgrade pip)
|
||||
-(cd $(WINPY32_DIR) && cat requirements.txt | while read PAC ; do Scripts/pip3.exe install "$${PAC}" ; done)
|
||||
-(cd $(WINPY32_DIR) && Scripts/pip3.exe freeze)
|
||||
rm $(WINPY32_DIR)/requirements.txt
|
||||
cp $(SERVER_DIRECTORY)/requirements.txt $(WINPY64_DIR)/
|
||||
-(cd $(WINPY64_DIR) && ./python.exe -m pip install --upgrade pip)
|
||||
-(cd $(WINPY64_DIR) && cat requirements.txt | while read PAC ; do Scripts/pip3.exe install "$${PAC}" ; done)
|
||||
-(cd $(WINPY64_DIR) && Scripts/pip3.exe freeze)
|
||||
rm $(WINPY64_DIR)/requirements.txt
|
||||
(cd $(SERVER_DIRECTORY)/setup/win32 && $(LAUNCH_MAKENSIS))
|
||||
(cd $(SERVER_DIRECTORY)/setup/win32 && mkdir -p $(FILES_DIRECTORY))
|
||||
(cd $(SERVER_DIRECTORY)/setup/win32 && cp openerp-*.exe $(FILES_DIRECTORY)/openerp-server-setup-$(VERSION).exe)
|
||||
(cd $(SERVER_DIRECTORY)/setup/win32 && cp odoo_setup_*.exe $(FILES_DIRECTORY)/)
|
||||
(cd $(SERVER_DIRECTORY)/setup/win32/$(FILES_DIRECTORY) && chmod 0766 odoo_setup_*.exe)
|
||||
|
||||
+76
-63
@@ -4,6 +4,8 @@
|
||||
# TODO: We can update the server or the clients without to uninstall the all-in-one
|
||||
# TODO: Add startmenu handling (link to localhost + uninstall)
|
||||
|
||||
Unicode True
|
||||
|
||||
!include 'MUI2.nsh'
|
||||
!include 'FileFunc.nsh'
|
||||
!include 'LogicLib.nsh'
|
||||
@@ -15,12 +17,12 @@
|
||||
Push $R0
|
||||
Push $R1
|
||||
Push $R2
|
||||
|
||||
|
||||
# XXX bug if ${ROOT}, ${MAIN_KEY} or ${KEY} use $R0 or $R1
|
||||
|
||||
|
||||
StrCpy $R1 "0" # loop index
|
||||
StrCpy $R2 "0" # not found
|
||||
|
||||
|
||||
${Do}
|
||||
EnumRegKey $R0 ${ROOT} "${MAIN_KEY}" "$R1"
|
||||
${If} $R0 == "${KEY}"
|
||||
@@ -29,9 +31,9 @@
|
||||
${EndIf}
|
||||
IntOp $R1 $R1 + 1
|
||||
${LoopWhile} $R0 != ""
|
||||
|
||||
|
||||
ClearErrors
|
||||
|
||||
|
||||
Exch 2
|
||||
Pop $R0
|
||||
Pop $R1
|
||||
@@ -41,7 +43,7 @@
|
||||
!define PUBLISHER 'Odoo S.A.'
|
||||
|
||||
!ifndef MAJOR_VERSION
|
||||
!define MAJOR_VERSION '13'
|
||||
!define MAJOR_VERSION '14'
|
||||
!endif
|
||||
|
||||
!ifndef MINOR_VERSION
|
||||
@@ -53,20 +55,30 @@
|
||||
!endif
|
||||
|
||||
!ifndef VERSION
|
||||
!define VERSION "0"
|
||||
#!define VERSION "${MAJOR_VERSION}.${MINOR_VERSION}-r${REVISION_VERSION}"
|
||||
!define VERSION "${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||
!endif
|
||||
|
||||
!ifndef PYTHONVERSION
|
||||
!define PYTHONVERSION '3.7.4'
|
||||
!endif
|
||||
|
||||
!ifndef SERVICENAME
|
||||
!define SERVICENAME 'odoo-server-${VERSION}'
|
||||
!endif
|
||||
|
||||
!ifndef TOOLSDIR
|
||||
!define TOOLSDIR 'c:\odoobuild'
|
||||
!endif
|
||||
|
||||
!define PRODUCT_NAME "Odoo"
|
||||
!define DISPLAY_NAME "${PRODUCT_NAME} ${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||
|
||||
!define REGISTRY_ROOT HKLM
|
||||
!define UNINSTALL_BASE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
|
||||
!define UNINSTALL_REGISTRY_KEY "${UNINSTALL_BASE_REGISTRY_KEY}\${DISPLAY_NAME}"
|
||||
|
||||
!define UNINSTALL_REGISTRY_KEY_SERVER "${UNINSTALL_BASE_REGISTRY_KEY}\Odoo Server ${VERSION}"
|
||||
|
||||
!define REGISTRY_KEY "Software\${DISPLAY_NAME}"
|
||||
!define REGISTRY_KEY "SOFTWARE\${DISPLAY_NAME}"
|
||||
|
||||
!define DEFAULT_POSTGRESQL_HOSTNAME 'localhost'
|
||||
!define DEFAULT_POSTGRESQL_PORT 5432
|
||||
@@ -75,28 +87,14 @@
|
||||
|
||||
Name '${DISPLAY_NAME}'
|
||||
Caption "${PRODUCT_NAME} ${VERSION} Setup"
|
||||
OutFile "openerp-allinone-setup-${VERSION}.exe"
|
||||
OutFile "odoo_setup_${VERSION}.exe"
|
||||
SetCompressor /FINAL lzma
|
||||
#SetCompress auto
|
||||
ShowInstDetails show
|
||||
|
||||
#XPStyle on
|
||||
|
||||
InstallDir "$PROGRAMFILES\Odoo ${VERSION}"
|
||||
InstallDirRegKey HKCU "${REGISTRY_KEY}" ""
|
||||
|
||||
BrandingText '${PRODUCT_NAME} ${VERSION}'
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
#VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
|
||||
#VIAddVersionKey "CompanyName" "${PUBLISHER}"
|
||||
#VIAddVersionKey "FileDescription" "Installer of ${DISPLAY_NAME}"
|
||||
#VIAddVersionKey "LegalCopyright" "${PUBLISHER}"
|
||||
#VIAddVersionKey "LegalTrademark" "OpenERP is a trademark of ${PUBLISHER}"
|
||||
#VIAddVersionKey "FileVersion" "${MAJOR_VERSION}.${MINOR_VERSION}.${REVISION_VERSION}"
|
||||
#VIProductVersion "${MAJOR_VERSION}.${MINOR_VERSION}.${REVISION_VERSION}"
|
||||
|
||||
!insertmacro GetParameters
|
||||
!insertmacro GetOptions
|
||||
|
||||
@@ -116,16 +114,14 @@ Var HWNDPostgreSQLPassword
|
||||
|
||||
!define STATIC_PATH "static"
|
||||
!define PIXMAPS_PATH "${STATIC_PATH}\pixmaps"
|
||||
!define POSTGRESQL_EXE_FILENAME "postgresql-9.5.8-1-windows.exe"
|
||||
!define POSTGRESQL_EXE "${STATIC_PATH}\${POSTGRESQL_EXE_FILENAME}"
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "${PIXMAPS_PATH}\openerp-icon.ico"
|
||||
!define MUI_ICON "${PIXMAPS_PATH}\odoo-icon.ico"
|
||||
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "${PIXMAPS_PATH}\openerp-intro.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${PIXMAPS_PATH}\openerp-intro.bmp"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "${PIXMAPS_PATH}\odoo-intro.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${PIXMAPS_PATH}\odoo-intro.bmp"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "${PIXMAPS_PATH}\openerp-slogan.bmp"
|
||||
!define MUI_HEADERIMAGE_BITMAP "${PIXMAPS_PATH}\odoo-slogan.bmp"
|
||||
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
|
||||
!define MUI_HEADER_TRANSPARENT_TEXT ""
|
||||
|
||||
@@ -143,7 +139,7 @@ Page Custom ShowPostgreSQL LeavePostgreSQL
|
||||
!define MUI_FINISHPAGE_RUN_CHECKED
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "$(DESC_FinishPageText)"
|
||||
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
|
||||
!define MUI_FINISHPAGE_LINK $(DESC_FinishPage_Link)
|
||||
!define MUI_FINISHPAGE_LINK $(DESC_FinishPage_Link)
|
||||
!define MUI_FINISHPAGE_LINK_LOCATION "https://www.odoo.com/page/contactus"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
@@ -157,7 +153,7 @@ Page Custom ShowPostgreSQL LeavePostgreSQL
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
; English
|
||||
LangString DESC_OpenERP_Server ${LANG_ENGLISH} "Install the Odoo Server with all the Odoo standard modules."
|
||||
LangString DESC_Odoo_Server ${LANG_ENGLISH} "Install the Odoo Server with all the Odoo standard modules."
|
||||
LangString DESC_PostgreSQL ${LANG_ENGLISH} "Install the PostgreSQL RDBMS used by Odoo."
|
||||
LangString DESC_FinishPage_Link ${LANG_ENGLISH} "Contact Odoo for Partnership and/or Support"
|
||||
LangString DESC_AtLeastOneComponent ${LANG_ENGLISH} "You have to choose at least one component"
|
||||
@@ -173,12 +169,12 @@ LangString DESC_PostgreSQL_Username ${LANG_ENGLISH} "Username"
|
||||
LangString DESC_PostgreSQL_Password ${LANG_ENGLISH} "Password"
|
||||
LangString Profile_AllInOne ${LANG_ENGLISH} "All In One"
|
||||
LangString Profile_Server ${LANG_ENGLISH} "Server only"
|
||||
LangString TITLE_OpenERP_Server ${LANG_ENGLISH} "Odoo Server"
|
||||
LangString TITLE_Odoo_Server ${LANG_ENGLISH} "Odoo Server"
|
||||
LangString TITLE_PostgreSQL ${LANG_ENGLISH} "PostgreSQL Database"
|
||||
LangString DESC_FinishPageText ${LANG_ENGLISH} "Start Odoo"
|
||||
|
||||
; French
|
||||
LangString DESC_OpenERP_Server ${LANG_FRENCH} "Installation du Serveur Odoo avec tous les modules Odoo standards."
|
||||
LangString DESC_Odoo_Server ${LANG_FRENCH} "Installation du Serveur Odoo avec tous les modules Odoo standards."
|
||||
LangString DESC_PostgreSQL ${LANG_FRENCH} "Installation de la base de données PostgreSQL utilisée par Odoo."
|
||||
LangString DESC_FinishPage_Link ${LANG_FRENCH} "Contactez Odoo pour un Partenariat et/ou du Support"
|
||||
LangString DESC_AtLeastOneComponent ${LANG_FRENCH} "Vous devez choisir au moins un composant"
|
||||
@@ -194,31 +190,33 @@ LangString DESC_PostgreSQL_Username ${LANG_FRENCH} "Utilisateur"
|
||||
LangString DESC_PostgreSQL_Password ${LANG_FRENCH} "Mot de passe"
|
||||
LangString Profile_AllInOne ${LANG_FRENCH} "All In One"
|
||||
LangString Profile_Server ${LANG_FRENCH} "Seulement le serveur"
|
||||
LangString TITLE_OpenERP_Server ${LANG_FRENCH} "Serveur Odoo"
|
||||
LangString TITLE_Odoo_Server ${LANG_FRENCH} "Serveur Odoo"
|
||||
LangString TITLE_PostgreSQL ${LANG_FRENCH} "Installation du serveur de base de données PostgreSQL"
|
||||
LangString DESC_FinishPageText ${LANG_FRENCH} "Démarrer Odoo"
|
||||
|
||||
InstType $(Profile_AllInOne)
|
||||
InstType $(Profile_Server)
|
||||
|
||||
Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
|
||||
Section $(TITLE_Odoo_Server) SectionOdoo_Server
|
||||
SectionIn 1 2
|
||||
|
||||
# TODO: install in a temp dir before
|
||||
|
||||
# Installing winpython
|
||||
SetOutPath "$INSTDIR\python"
|
||||
File /r /x "__pycache__" "..\..\..\WinPython\python-${PYTHONVERSION}\*"
|
||||
${If} ${RunningX64}
|
||||
File /r /x "__pycache__" "${TOOLSDIR}\WinPy64\python-${PYTHONVERSION}.amd64\*"
|
||||
${Else}
|
||||
File /r /x "__pycache__" "${TOOLSDIR}\WinPy32\python-${PYTHONVERSION}\*"
|
||||
${EndIf}
|
||||
|
||||
SetOutPath "$INSTDIR\nssm"
|
||||
File /r /x "src" "..\..\..\nssm-2.24\*"
|
||||
File /r /x "src" "${TOOLSDIR}\nssm-2.24\*"
|
||||
|
||||
SetOutPath "$INSTDIR\server"
|
||||
File /r /x "${POSTGRESQL_EXE_FILENAME}" /x "wkhtmltopdf" "..\..\*"
|
||||
File /r /x "wkhtmltopdf" "..\..\*"
|
||||
|
||||
SetOutPath "$INSTDIR\vcredist"
|
||||
File /r "..\..\..\vcredist\*.exe"
|
||||
|
||||
File /r "${TOOLSDIR}\vcredist\*.exe"
|
||||
|
||||
# Install Visual C redistribuable files
|
||||
DetailPrint "Installing Visual C++ redistributable files"
|
||||
${If} ${RunningX64}
|
||||
@@ -230,7 +228,7 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
|
||||
SetOutPath "$INSTDIR\thirdparty"
|
||||
File /r "${STATIC_PATH}\wkhtmltopdf\*"
|
||||
|
||||
# If there is a previous install of the OpenERP Server, keep the login/password from the config file
|
||||
# If there is a previous install of the Odoo Server, keep the login/password from the config file
|
||||
WriteIniStr "$INSTDIR\server\odoo.conf" "options" "db_host" $TextPostgreSQLHostname
|
||||
WriteIniStr "$INSTDIR\server\odoo.conf" "options" "db_user" $TextPostgreSQLUsername
|
||||
WriteIniStr "$INSTDIR\server\odoo.conf" "options" "db_password" $TextPostgreSQLPassword
|
||||
@@ -254,7 +252,7 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
|
||||
nsExec::ExecToLog '"$INSTDIR\nssm\win32\nssm.exe" install ${SERVICENAME} "$INSTDIR\python\python.exe" "\"$INSTDIR\server\odoo-bin\""'
|
||||
nsExec::ExecToLog '"$INSTDIR\nssm\win32\nssm.exe" set ${SERVICENAME} AppDirectory "$\"$INSTDIR\server$\""'
|
||||
${EndIf}
|
||||
|
||||
|
||||
nsExec::Exec "net stop ${SERVICENAME}"
|
||||
sleep 2
|
||||
|
||||
@@ -262,13 +260,24 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
|
||||
sleep 2
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
||||
Section $(TITLE_PostgreSQL) SectionPostgreSQL
|
||||
SectionIn 1 2
|
||||
SetOutPath '$TEMP'
|
||||
VAR /GLOBAL postgresql_exe_filename
|
||||
VAR /GLOBAL postgresql_url
|
||||
|
||||
${If} ${RunningX64}
|
||||
StrCpy $postgresql_exe_filename "postgresql-12.4-1-windows-x64.exe"
|
||||
${Else}
|
||||
StrCpy $postgresql_exe_filename "postgresql-10.14-1-windows.exe"
|
||||
${EndIf}
|
||||
|
||||
StrCpy $postgresql_url "https://get.enterprisedb.com/postgresql/$postgresql_exe_filename"
|
||||
nsExec::Exec 'net user openpgsvc /delete'
|
||||
|
||||
File ${POSTGRESQL_EXE}
|
||||
inetc::get "$postgresql_url" "$TEMP/$postgresql_exe_filename" /POPUP
|
||||
pop $0
|
||||
|
||||
ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
|
||||
StrCmp $0 "" win9x
|
||||
@@ -277,7 +286,7 @@ Section $(TITLE_PostgreSQL) SectionPostgreSQL
|
||||
ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ComputerName" "ComputerName"
|
||||
done:
|
||||
Rmdir /r "$INSTDIR\PostgreSQL"
|
||||
ExecWait '"$TEMP\${POSTGRESQL_EXE_FILENAME}" \
|
||||
ExecWait '"$TEMP\$postgresql_exe_filename" \
|
||||
--mode unattended \
|
||||
--prefix "$INSTDIR\PostgreSQL" \
|
||||
--datadir "$INSTDIR\PostgreSQL\data" \
|
||||
@@ -293,9 +302,6 @@ Section -Post
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "DisplayName" "${DISPLAY_NAME}"
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "DisplayVersion" "${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "Publisher" "${PUBLISHER}"
|
||||
; WriteRegDWORD HKLM "${UNINSTALL_REGISTRY_KEY}" "Version" "${VERSION}"
|
||||
; WriteRegDWORD HKLM "${UNINSTALL_REGISTRY_KEY}" "VersionMajor" "${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||
; WriteRegDWORD HKLM "${UNINSTALL_REGISTRY_KEY}" "VersionMinor" "${REVISION_VERSION}"
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "HelpLink" "support@odoo.com"
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "HelpTelephone" "+32.81.81.37.00"
|
||||
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "URLInfoAbout" "https://www.odoo.com"
|
||||
@@ -306,7 +312,7 @@ Section -Post
|
||||
SectionEnd
|
||||
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SectionOpenERP_Server} $(DESC_OpenERP_Server)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SectionOdoo_Server} $(DESC_Odoo_Server)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SectionPostgreSQL} $(DESC_PostgreSQL)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
@@ -329,11 +335,23 @@ Section "Uninstall"
|
||||
SectionEnd
|
||||
|
||||
Function .onInit
|
||||
Push $R0
|
||||
VAR /GLOBAL previous_install_dir
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
ReadRegStr $previous_install_dir HKLM "${REGISTRY_KEY}" "Install_Dir"
|
||||
${If} $previous_install_dir == ""
|
||||
${If} ${RunningX64}
|
||||
StrCpy $INSTDIR "$PROGRAMFILES64\Odoo ${VERSION}"
|
||||
${Else}
|
||||
StrCpy $INSTDIR "$PROGRAMFILES\Odoo ${VERSION}"
|
||||
${EndIf}
|
||||
WriteRegStr HKLM "${REGISTRY_KEY}" "Install_dir" "$INSTDIR"
|
||||
${EndIf}
|
||||
|
||||
Push $R0
|
||||
${GetParameters} $cmdLineParams
|
||||
ClearErrors
|
||||
|
||||
Pop $R0
|
||||
|
||||
StrCpy $Option_AllInOne 0
|
||||
@@ -357,7 +375,7 @@ Function .onInit
|
||||
MessageBox MB_OK|MB_ICONINFORMATION "All In One"
|
||||
|
||||
NoAllInOneMode:
|
||||
|
||||
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
|
||||
ClearErrors
|
||||
@@ -365,7 +383,6 @@ Function .onInit
|
||||
IfErrors DoInstallPostgreSQL 0
|
||||
StrCmp $0 "" DoInstallPostgreSQL
|
||||
StrCpy $HasPostgreSQL 1
|
||||
#SectionSetText ${SectionPostgreSQL} ""
|
||||
!insertmacro UnselectSection ${SectionPostgreSQL}
|
||||
SectionSetFlags ${SectionPostgreSQL} ${SF_RO}
|
||||
|
||||
@@ -382,7 +399,7 @@ Function PostgreSQLOnBack
|
||||
FunctionEnd
|
||||
|
||||
Function ShowPostgreSQL
|
||||
SectionGetFlags ${SectionOpenERP_Server} $0
|
||||
SectionGetFlags ${SectionOdoo_Server} $0
|
||||
IntOp $0 $0 & ${SF_SELECTED}
|
||||
IntCmp $0 ${SF_SELECTED} LaunchPostgreSQLConfiguration
|
||||
Abort
|
||||
@@ -453,7 +470,7 @@ Function LeavePostgreSQL
|
||||
FunctionEnd
|
||||
|
||||
Function ComponentLeave
|
||||
SectionGetFlags ${SectionOpenERP_Server} $0
|
||||
SectionGetFlags ${SectionOdoo_Server} $0
|
||||
IntOp $0 $0 & ${SF_SELECTED}
|
||||
IntCmp $0 ${SF_SELECTED} Done
|
||||
|
||||
@@ -461,10 +478,6 @@ Function ComponentLeave
|
||||
IntOp $0 $0 & ${SF_SELECTED}
|
||||
IntCmp $0 ${SF_SELECTED} DontInstallPostgreSQL
|
||||
|
||||
ChooseAtLeastOneComponent:
|
||||
MessageBox MB_ICONEXCLAMATION|MB_OK $(DESC_AtLeastOneComponent)
|
||||
Abort
|
||||
|
||||
DontInstallPostgreSQL:
|
||||
MessageBox MB_ICONEXCLAMATION|MB_OK $(DESC_CanNotInstallPostgreSQL)
|
||||
Abort
|
||||
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Reference in New Issue
Block a user