Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

-1

[to clean] HOWTO build setup allinone v5 using windows with sources - save/restore db

By
Cyril Gaspard (GEM)
on 3/10/13, 11:26 AM 1,589 views

Here, steps to have configuration to build setup for windows :

original link :

http://forum.openerp.com/forum/topic12184-60.html

Info from topic :

http://www.openobject.com/forum/topic10994.html original procedure : http://bazaar.launchpad.net/~openerp/openerp/win-installer-trunk/annotate/head%3A/doc/INSTALL

thanks to :

openerp & Axelor : for the work , codes and scripts Stéphane Wirtel : for originals scripts and libraries ChristianD : for answers dharival , David L: for questions and answers hda & Christophe Chauvet for last link stable extra addons and compatibility versions problem GEM

First, it's necessary to clean your computer :

Uninstall GTK, GTK-dev if you don’t have version 2.12.9 Uninstall all programs with GTK include like the gimp or Dia (to build openerp module with UML) Uninstall python-2.5 and all modules, at the end delete the folder python25

After uninstall openerp you should clean up too

delete files/folders : vista : in C:\user\admin_user .openerprc (or .terprc), openerp-client.log, in C:\Users\Administrateur\AppData\Roaming\ postgresql in C:\user delete all user postgresql "openpgsvc"

xp : C:\Documents and Settings\USER\Application Data\ postgresql C:\Documents and Settings\USER\ all user postgresql "openpgsvc", .openerprc (or .terprc), openerp-client.log, clean your folder C:\WINDOWS\Prefetch (all postgres files)

Clean registry with programs like glary utilities XOR ccleaner http://www.glaryutilities.com/ http://www.piriform.com/ccleaner/download you must clean completly registry (start->execute type regedit) with keyword (CTRL+F check just key) openerp (delete allinone, client, web openerpc .....), openpg, pga (pgadmin III, pgagent), postgresql, pgsql. clean before all new installation of openerp.

install python 2.5 : http://www.python.org/download/releases/2.5.4/ install standalone bazaar and last version python 2.5 based and install its. http://wiki.bazaar.canonical.com/WindowsDownloads:

create a folder to stock sources and build : C:\openerp

download manually all python libraries : http://bazaar.launchpad.net/~openerp/openerp/win-installer-trunk/files/head%3A/dependencies/ or automatically with bazaar : Open a windows console start->execute cmd ok cd C:\ openerp (enter) bzr branch lp:~openerp/openerp/win-installer-trunk (enter) (don’t worry for the warning’s message of launchpad, stand the end, a few minutes) a new folder has been created : C:\openerp\win-installer-trunk copy all in win-installer\ and copy it in C:\openerp

install programs and libraries (with installation and options by default=>else scripts don’t work) which are in the folder dependencies, just this listing and in this order :

[color=red]Finally you must just install the listing of libraries given by the OpenERP Quick Installation Guide (nothing else to download) :

differences with OpenERP Quick Installation Guide : do not install pytz-2008i (because in server\bin\addons\base\res\res_user.py, the fonction _tz_get call pytz.all_timezones, and in pytz-2008i there is not all_timezones) egenix-pyopenssl is not in the listing, but is downloaded with bazaar in dependencies. numpy-1.1.1 becomes numpy 1.2.1 (bug with numpy-1.1.1)[/color]

nsis-2.40-setup.exe graphviz-2.20.2.exe (do not install pytz-2008i.win32.exe but if you want, you must add at the end the listing of timezone all_timezone and common-timezone) egenix-mx-base-3.1.1.win32-py2.5.msi egenix-pyopenssl-0.8.0_0.9.8i_1.win32-py2.5.msi (not in the OpenERP Quick Installation Guide) PyXML-0.8.4.win32-py2.5.exe libxml2-python-2.7.1.win32-py2.5.exe lxml-2.1.2.win32-py2.5.exe matplotlib-0.98.3.win32-py2.5.exe numpy-1.2.1-win32-superpack-python2.5.exe PIL-1.1.6.win32-py2.5.exe PyChart-1.39.win32.exe ( created by Stephane Wirtel ) ReportLab-2.2.win32-py2.5.exe vobject-0.7.1.win32.exe ( created by Stephane Wirtel ) pygobject-2.14.1-1.win32-py2.5.exe pygtk-2.12.1-2.win32-py2.5.exe pycairo-1.4.12-1.win32-py2.5.exe install by default (in C:\GTK with options by default) gtk-2.12.9-win32-2.exe install by default (in C:\GTK with options by default ) gtk-dev-2.12.9-win32-2.exe pydot-1.0.2.win32.exe ( created by Stephane Wirtel ) pyparsing-1.5.0.win32.exe pywin32-212.win32-py2.5.exe py2exe-0.6.8.win32-py2.5.exe hippo-canvas-0.3.0-win32.zip unzip (files "libhippocanvas-1-0.dll" and "hippo.pyd") in C:\Python25\DLLs\ msvcp71.zip unzip dll (msvcp71.dll) in C:\WINDOWS\SYSTEM32 if it is not installed psycopg2-2.0.8.win32-py2.5-pg8.3.4-release.exe setuptools-0.6c9.win32-py2.5.exe [color=red]Mako-0.3.1.win32.exe[/color]

[color=red]in C:\python25\Lib\site-packages\matplotlib\figure.py line 623 and 624 comment the line with "#" you must have : #add_axes.__doc__ = add_axes.__doc__ % (", ".join(get_projection_names()), '%(Axes)s') #add_axes.__doc__ = dedent(add_axes.__doc__) % artist.kwdocd delete figure.pyo and figure.pyc [/color] (if you want an editor with line number download notepad++ : http://notepad-plus.sourceforge.net/fr/site.htm)

verify environment variables : on deskop right clic on computer->properties->advanced parameters system->environment variable in system variable clic on "path": you should have : %GTK_BASEPATH%\bin; C:\Python25; C:\Python25\scripts; C:\Program Files\NSIS\bin; C:\Program Files\NSIS; C:\Program Files\Graphviz2.20\bin;

[color=red]Do this if there is an error pytz timezone in client gtk(bug fixed)/color search name of your local timezone in your windows : start->execute type regedit go to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Time Zones/ search your timezone by example for me "Romance Standard Time" -> subkey on the right "std" value "Paris, Madrid" copy python25\Lib\site-packages\pytz\zoneinfo\Europe\Paris in python25\Lib\site-packages\pytz\zoneinfo\Paris, Madrid in python25\Lib\site-packages\pytz__init__.py at the end of the script in all_timezones list add the line : 'Paris, Madrid', you must do this with your own timezone installed on your computer.[/color]

You have now installed all you need to build the different setup with following scripts : warning : the trunk version is not stable, but you can change 5.0 by trunk if you want.

[color=red]scripts without update of sources : [/color]

BUILD OPENERP ALLINONE AND INDEPENDENT SERVER, CLIENT GTK AND CLIENT WEB :

In C:\openerp\make.bat right click modify File->Save as name_of_script.bat

Delete all, paste, save, read commentary of this :

::beginning of script :: Disabled/Enable echoing @echo off

:: Set some script wide variable set POSTGRESQL_MSI=postgresql-8.3-int.msi set OPENERP_NSIS=setup.nsi set OPENERP_DEMO_DIR=demo

:: Get current date (YYYYMMDD) set TODAY=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2% :: Save current directory set TOPDIR=%CD%

:: Set correct a subdirectory for packaging, :: dont trash the current directory... set SUBDIR=%1 if "%1"=="" goto usage if "%2"=="" goto usage set VERSION=%2

goto create_subdir

:usage echo "make.bat TITLE_OF_BUILD VERSION" goto end

:: Prepare sub-directory :create_subdir echo Creating subdir %SUBDIR%. mkdir %SUBDIR% echo.

echo Copying PostgreSQL installer... copy /Y %POSTGRESQL_MSI% %SUBDIR% echo. echo Copying OpenERP Nullsoft installer script... copy /Y %OPENERP_NSIS% %SUBDIR% echo. echo Copying `demo' files... mkdir %SUBDIR%\demo xcopy /E /I /Y %OPENERP_DEMO_DIR% %SUBDIR%\demo cd %SUBDIR%

:: Get sources from launchpad :bzr_clone

echo. echo Downloading OpenERP Server/Development version... bzr clone lp:~openerp/openobject-server/5.0 server echo OpenERP Server downloaded !

echo. echo Downloading OpenERP Client/Development version... bzr clone lp:~openerp/openobject-client/5.0 client echo OpenERP Client downloaded !

echo. echo Downloading OpenERP Web Client/Development version... bzr clone lp:~openerp/openobject-client-web/5.0 client-web echo OpenERP Web Client downloaded !

echo. echo Downloading OpenERP Addons/Development version... bzr clone lp:openobject-addons/5.0 server\bin\addons echo OpenERP Addons downloaded !

:: delete ":" for each line if you want extra-addons :echo. :echo Downloading OpenERP extra-addons/Development version... :bzr branch lp:openobject-addons/extra-5.0 extra-addons :xcopy /E /Y extra-addons* server\bin\addons\ :echo OpenERP extra-addons downloaded !

:clean build and dist python file compiled :rmdir /S /Q client-web\win32\build :rmdir /S /Q client-web\build :rmdir /S /Q server\win32\build :rmdir /S /Q server\build :rmdir /S /Q server\win32\dist :rmdir /S /Q server\dist :rmdir /S /Q client\build :rmdir /S /Q client\dist :del /F client\msgfmt.pyc :del /F client\mydistutils.pyc :del /F C:\openerp\trunk\client-web\win32\util.pyc

:packaging

:: package clients echo. echo begin client build cd client python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /V1 setup.nsi move /Y openerp-client-setup-%VERSION%.exe .. makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo end clients build

:: package servers echo. echo begin server build cd .. cd server\win32 python setup.py --quiet py2exe cd .. python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /V1 setup.nsi move /Y openerp-server-setup-%VERSION%.exe .. makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo end servers build

:: package client-web echo. echo begin client-web build cd .. cd client-web del /F win32\openerp-web* python win32\setup.py --quiet bdist_wininst move /Y win32\openerp-web* win32\openerp-web-setup-%VERSION%.exe makensis /DVERSION=%VERSION% /V1 win32\setup.nsi move /Y win32\openerp-web-* .. makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 win32\setup.nsi move /Y win32\openerp-web-* openerp-web-setup-%VERSION%.exe echo. echo end client-web build

:: package all-in-one echo. echo begin allinone build cd .. makensis /DVERSION=%VERSION% /V1 setup.nsi echo. echo end allinone build

:end

:: Do some clean-up, :: return to TOPDIR, and unset script environment vars :cleanup cd %TOPDIR% set POSTGRESQL_MSI= set OPENERP_NSIS= set OPENERP_DEMO_DIR= set TODAY= set TOPDIR= set SUBDIR=

pause ::end of script

Save the file

to lauch a script :

start->execute type cmd, in the console, type: Cd C:\ openerp\ (enter) name_of_script.bat trunk 5.0.6-ok (enter, some minutes)

trunk is the folder which will be created, in which sources and build will be stocked (you can choose what you want) 5.0.6-ok is the name for the build (you can choose what you want)

The build setup is stocked in my case, in the folder C:\ openerp\trunk

You can install your openerp allinone setup (uninstall precedent first naturally)

NOTICE :

If you don’t change the folder to stock build and sources, (first argument after make.bat, here : trunk, bazaar don’t download a second time the sources.

If you want to insert a database in the allinone installer or server follow this (not tested) : In the folder C:...\wininstaller-trunk\trunk\server in the file setup.nsi, insert this command at the end : ExecWait '"$PROGRAMFILES\PostgreSQL4TinyERP\bin\pg_dump" -d postgres -C "$PROGRAMFILES\OpenERP Server\addons\mydatabase.backup" -U openpg' IfErrors 0 +2 MessageBox MB_OK "Database Dump Finished" Type the good PATH, database name and id admin for postgresql(openpg by default for all in one)

BUILD OPENERP SETUP ALLINONE :

In C:\openerp\make.bat right click modify File->Save as make-allinone.bat

Delete all, paste, save, read commentary of this :

::beginning of script :: Disabled/Enable echoing @echo off

:: Set some script wide variable set POSTGRESQL_MSI=postgresql-8.3-int.msi set OPENERP_NSIS=setup.nsi set OPENERP_DEMO_DIR=demo

:: Get current date (YYYYMMDD) set TODAY=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2% :: Save current directory set TOPDIR=%CD%

:: Set correct a subdirectory for packaging, :: dont trash the current directory... set SUBDIR=%1 if "%1"=="" goto usage if "%2"=="" goto usage set VERSION=%2

goto create_subdir

:usage echo "make.bat TITLE_OF_BUILD VERSION" goto end

:: Prepare sub-directory :create_subdir echo Creating subdir %SUBDIR%. mkdir %SUBDIR% echo.

echo Copying PostgreSQL installer... copy /Y %POSTGRESQL_MSI% %SUBDIR% echo. echo Copying OpenERP Nullsoft installer script... copy /Y %OPENERP_NSIS% %SUBDIR% echo. echo Copying `demo' files... mkdir %SUBDIR%\demo xcopy /E /I /Y %OPENERP_DEMO_DIR% %SUBDIR%\demo cd %SUBDIR%

:: Get sources from launchpad :bzr_clone

echo. echo Downloading OpenERP Server/Development version... bzr clone lp:~openerp/openobject-server/5.0 server echo OpenERP Server downloaded !

echo. echo Downloading OpenERP Client/Development version... bzr clone lp:~openerp/openobject-client/5.0 client echo OpenERP Client downloaded !

echo. echo Downloading OpenERP Web Client/Development version... bzr clone lp:~openerp/openobject-client-web/5.0 client-web echo OpenERP Web Client downloaded !

echo. echo Downloading OpenERP Addons/Development version... bzr clone lp:openobject-addons/5.0 server\bin\addons\ echo OpenERP Addons downloaded !

:: delete ":" for each line if you want extra-addons :echo. :echo Downloading OpenERP extra-addons/Development version... :bzr branch lp:openobject-addons/extra-5.0 extra-addons :xcopy /E /Y extra-addons* server\bin\addons\ :echo OpenERP extra-addons downloaded !

:clean build and dist python file compiled :rmdir /S /Q client-web\win32\build :rmdir /S /Q client-web\build :rmdir /S /Q server\win32\build :rmdir /S /Q server\build :rmdir /S /Q server\win32\dist :rmdir /S /Q server\dist :rmdir /S /Q client\build :rmdir /S /Q client\dist :del /F client\msgfmt.pyc :del /F client\mydistutils.pyc :del /F C:\openerp\trunk\client-web\win32\util.pyc

:packaging

:: package client for allinone echo. echo begin client build cd client python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo end client build

:: package server for allinone echo. echo begin server build cd .. cd server\win32 python setup.py --quiet py2exe cd .. python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo end server build

:: package client-web for allinone echo. echo begin client-web build cd .. cd client-web del /F win32\openerp-web* python win32\setup.py --quiet bdist_wininst move /Y win32\openerp-web* win32\openerp-web-setup-%VERSION%.exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 win32\setup.nsi :move /Y win32\openobject-web-setup-* win32\openerp-web-setup-%VERSION%.exe move /Y win32\openerp-web-setup-%VERSION%.exe . echo. echo end client-web build

:: package all-in-one echo. echo begin allinone build cd .. makensis /DVERSION=%VERSION% /V1 setup.nsi echo. echo end allinone build

:end

:: Do some clean-up, :: return to TOPDIR, and unset script environment vars :cleanup cd %TOPDIR% set POSTGRESQL_MSI= set OPENERP_NSIS= set OPENERP_DEMO_DIR= set TODAY= set TOPDIR= set SUBDIR=

pause ::end of script

BUILD SERVER+CLIENT-GTK+CLIENT-WEB INDEPENDANT

In C:\openerp\win-installer-trunk\ make.bat right click modify File->Save as make-allinone-solo.bat

Delete all, paste, save, read commentary of this :

::beginning of script :: Disabled/Enable echoing @echo off

:: Set some script wide variable set POSTGRESQL_MSI=postgresql-8.3-int.msi set OPENERP_NSIS=setup.nsi set OPENERP_DEMO_DIR=demo

:: Get current date (YYYYMMDD) set TODAY=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2% :: Save current directory set TOPDIR=%CD%

:: Set correct a subdirectory for packaging, :: dont trash the current directory... set SUBDIR=%1 if "%1"=="" goto usage if "%2"=="" goto usage set VERSION=%2

goto create_subdir

:usage echo "make.bat TITLE_OF_BUILD VERSION" goto end

:: Prepare sub-directory :create_subdir echo Creating subdir %SUBDIR%. mkdir %SUBDIR% echo.

echo Copying PostgreSQL installer... copy /Y %POSTGRESQL_MSI% %SUBDIR% echo. echo Copying OpenERP Nullsoft installer script... copy /Y %OPENERP_NSIS% %SUBDIR% echo. echo Copying `demo' files... mkdir %SUBDIR%\demo xcopy /E /I /Y %OPENERP_DEMO_DIR% %SUBDIR%\demo cd %SUBDIR%

:: Get sources from launchpad :bzr_clone

echo. echo Downloading OpenERP Server/Development version... bzr clone lp:~openerp/openobject-server/5.0 server echo OpenERP Server downloaded !

echo. echo Downloading OpenERP Client/Development version... bzr clone lp:~openerp/openobject-client/5.0 client echo OpenERP Client downloaded !

echo. echo Downloading OpenERP Web Client/Development version... bzr clone lp:~openerp/openobject-client-web/5.0 client-web echo OpenERP Web Client downloaded !

echo. echo Downloading OpenERP Addons/Development version... bzr clone lp:openobject-addons/5.0 server\bin\addons\ echo OpenERP Addons downloaded !

:: delete ":" for each line if you want extra-addons :echo. :echo Downloading OpenERP extra-addons/Development version... :bzr branch lp:openobject-addons/extra-5.0 extra-addons :xcopy /E /Y extra-addons* server\bin\addons\ :echo OpenERP extra-addons downloaded !

:clean build and dist python file compiled :rmdir /S /Q client-web\win32\build :rmdir /S /Q client-web\build :rmdir /S /Q server\win32\build :rmdir /S /Q server\build :rmdir /S /Q server\win32\dist :rmdir /S /Q server\dist :rmdir /S /Q client\build :rmdir /S /Q client\dist :del /F client\msgfmt.pyc :del /F client\mydistutils.pyc :del /F C:\openerp\trunk\client-web\win32\util.pyc

:packaging

:: package client echo. echo begin client build cd client python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /V1 setup.nsi echo. echo end client build

:: package server echo. echo begin server build cd .. cd server\win32 python setup.py --quiet py2exe cd .. python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /V1 setup.nsi echo. echo end server build

:: package client-web echo. echo begin client-web build cd .. cd client-web del /F win32\openerp-web* python win32\setup.py --quiet bdist_wininst move /Y win32\openerp-web-setup-* win32\openerp-web-setup-%VERSION%.exe makensis /DVERSION=%VERSION% /V1 win32\setup.nsi move /Y win32\openerp-web-setup-%VERSION%.exe . echo. echo end client-web build

cd ..

copy server\openerp-server-setup-%VERSION%.exe . copy client\openerp-client-setup-%VERSION%.exe . copy client-web\openerp-web-setup-%VERSION%.exe .

:end

:: Do some clean-up, :: return to TOPDIR, and unset script environment vars :cleanup cd %TOPDIR% set POSTGRESQL_MSI= set OPENERP_NSIS= set OPENERP_DEMO_DIR= set TODAY= set TOPDIR= set SUBDIR=

pause ::end of script

[color=red]script for automatic update of openerp sources :[/color]

install bzr library if not installed yet: easy_install bzrlib (package setuptools must be installed before)

download bzr_set.py in command line : cd c:\openerp bzr branch lp:openerp xcopy .\openrp\bzr_set.py trunk modify lines 56 58 with (change web by client-web and addons-extra by extra-addons):

'[color=red]extra-addons[/color]': (BASEURL + '~openerp-commiter/openobject-addons/' + extraversion + '-extra-addons', False), '[color=red]client-web[/color]': (BASEURL + '~openerp/openobject-client-web/' + webversion, True),

[color=green] for xp users : lauch a first time bzr_set.py : in console mode : cd c:\openerp\trunk python C:\openerp\trunk\bzr_set.py

after this step copy all files and folders of addons in c:\openerp\trunk\server\bin\addons

in bzr_set.py modify 'addons': (BASEURL + '~openerp/openobject-addons/' + version, True) by 'server\bin\addons': (BASEURL + '~openerp/openobject-addons/' + version, True)

for users vista and 7 only : (should not work on xp because new command mklink which computes symbolic link for windows doesn't work on xp, sorry!) :

use symlink used in bzr_set.py to have symbolic link for addons in script with automatic update :

download corrected lib by myself for python 2.5 of package jaraco and cbprint.py, extract directly in site-packages : http://dl.free.fr/plhSte5yH/jaraco.zip

for info steps to correct package jaraco.windows : https://bugs.launchpad.net/bzr/+bug/81689?comments=all

in bzr_set.py add line in the head of file : __import__('jaraco.windows.filesystem').windows.filesystem.patch_os_module()

keep your bazar repositery (do not copy addons in server\bin\addons, and don't replace in repository 'addons' by 'server\bin\addons') bzr_repository = { 'server': (BASEURL + '~openerp/openobject-server/' + version, True), 'client': (BASEURL + '~openerp/openobject-client/' + version, True), 'addons': (BASEURL + '~openerp/openobject-addons/' + version, True), 'extra-addons': (BASEURL + '~openerp-commiter/openobject-addons/' + extraversion + '-extra-addons', False), 'client-web': (BASEURL + '~openerp/openobject-client-web/' + webversion, True),

symlink should work now in script bzr_set.py

this method could be used to add extra addons automatically too, or others branchs, I think you should add the line in bzr_link : bzr_links = { 'addons\': 'server\bin\addons', 'extra-addons\': 'server\bin\addons', ......... } but warning, verify if there not modules which have the same name : to test if you need it. [/color]

script to build allinone with automatic update of sources with bzr_set.py : color=red[/color]

::beginning :: Disabled/Enable echoing @echo off

:: Set some script wide variable set POSTGRESQL_MSI=postgresql-8.3-int.msi set OPENERP_NSIS=setup.nsi set OPENERP_DEMO_DIR=demo

:: Get current date (YYYYMMDD) set TODAY=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2% :: Save current directory set TOPDIR=%CD%

:: Set correct a subdirectory for packaging, :: dont trash the current directory... set SUBDIR=%1 if "%1"=="" goto usage if "%2"=="" goto usage set VERSION=%2

goto create_subdir

:usage echo "make.bat TITLE_OF_BUILD VERSION" goto end

:: Prepare sub-directory :create_subdir echo Creating subdir %SUBDIR%. mkdir %SUBDIR% echo.

echo Copying PostgreSQL installer... copy /Y %POSTGRESQL_MSI% %SUBDIR% echo. echo Copying OpenERP Nullsoft installer script... copy /Y %OPENERP_NSIS% %SUBDIR% echo. echo Copying `demo' files... mkdir %SUBDIR%\demo xcopy /E /I /Y %OPENERP_DEMO_DIR% %SUBDIR%\demo cd %SUBDIR%

[color=red] ::unchecked this lines if you don't want to update :: for other scripts just change section Get sources like this : [/color]

python c:\openerp\trunk\bzr_set.py[/color]

::save and clean original files of server\bin\addons :mkdir server\bin\addons-temp :mkdir server\bin\addons-temp\base :xcopy /E /Y server\bin\addons\base* server\bin\addons-temp\base :xcopy /E /Y server\bin\addons__init__.py server\bin\addons-temp :xcopy /E /Y server\bin\addons\gen_graph.sh server\bin\addons-temp :xcopy /E /Y server\bin\addons\module_graph.py server\bin\addons-temp :rmdir /S /Q server\bin\addons :mkdir server\bin\addons :xcopy /E /Y server\bin\addons-temp* server\bin\addons\ :rmdir /S /Q server\bin\addons-temp

::update server with new addons and extra addons ::revision 1850 extra addons modules automatic install in server code :xcopy /E /Y addons* server\bin\addons\ :xcopy /E /-Y extra-addons* server\bin\addons\

:: Do some clean-up, :rmdir /S /Q client-web\win32\build :rmdir /S /Q client-web\build :rmdir /S /Q server\win32\build :rmdir /S /Q server\build :rmdir /S /Q server\win32\dist :rmdir /S /Q server\dist :rmdir /S /Q client\build :rmdir /S /Q client\dist :del /F client\msgfmt.pyc :del /F client\mydistutils.pyc :del /F C:\openerp\trunk\client-web\win32\util.pyc

:packaging

:: package client for allinone echo. echo beginning client build cd client python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo client build

:: package server for allinone echo. echo beginning server build cd .. cd server\win32 python setup.py --quiet py2exe cd .. python setup.py --quiet py2exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 setup.nsi echo. echo server build

:: package client-web for allinone echo. echo beginning client web build cd .. cd client-web del /F win32\openerp-web* python win32\setup.py --quiet bdist_wininst move /Y win32\openerp-web* win32\openerp-web-setup-%VERSION%.exe makensis /DVERSION=%VERSION% /DALLINONE=1 /V1 win32\setup.nsi move /Y win32\openerp-web-setup-%VERSION%.exe . echo client-web build

:: package all-in-one echo. echo beginning allinone build cd .. makensis /DVERSION=%VERSION% /V1 setup.nsi echo. echo all in one build echo.

::check uncheck if you want to keep or delete individual package :del /F client-web\openerp-web-* .\ :del /F client\openerp-client-* .\ :del /F server\openerp-server-* .\

:end

:: Do some clean-up, :: return to TOPDIR, and unset script environment vars :cleanup cd %TOPDIR% set POSTGRESQL_MSI= set OPENERP_NSIS= set OPENERP_DEMO_DIR= set TODAY= set TOPDIR= set SUBDIR=

pause ::end of script

3 possibilities to backup restore databases :

1) create scripts to delelete, save or restore a database in openerp :

create a simple file .cmd by create a file text with at the end the type of file .cmd you will have just click on this file to lauch your script, to modify it, right click and modify. I remember you to save a second backup of your data and system before to run this type of script. modify paths names ans option with your own configuration and context. It is possbile you have a message which says that a user is already connected, in this case, stop openerp server (after the script restart it naturally) if you have a doubt, consult postgresql documentation online with keyword pg_dump, pg_dump, dropdb. if a password is asked, put this of server.conf db_password I use commands made also in openerp's code, to see it : http://bazaar.launchpad.net/~openerp/openobject-server/5.0/view/head:/bin/service/web_services.py

[color=#FF0000]this scripts are for v5, for v6 change openerp-service by openerp-server, if you have v5 and v6 on the same machine, put the two at the beginning and at the end of each script : @net stop openerp-service @net stop openerp-server ..... @net start openerp-service @net start openerp-server[/color]

export add this lines in export.cmd :

[code]@echo off @net stop openerp-service @set PGPASSWORD=db_password @"absolute_path_to\postgresql\bin\pg_dump.exe" -F c -O -U db_user -h localhost -p 5432 database_name > "absolute_path_to_name_backup" @set PGPASSWORD= @net start openerp-service pause[/code]

variables db_user db_password are this of path_to\server\openerp-server.conf

import add this lines in import.cmd :

[code]@echo off @net stop openerp-service @set PGPASSWORD=db_password @"absolute_path_to\postgresql\bin\createdb.exe" -U db_user -T template0 database_name_to_create @"absolute_path_to\postgresql\bin\pg_restore.exe" -O -U db_user -h localhost -p 5432 -d database_name_to_create "absolute_path_of_database_backup" @set PGPASSWORD= @net start openerp-service pause[/code]

variables db_user db_password are this of path_to\server\openerp-server.conf

(it is possible you have a warning, don't worry, stand the end of the command, the database is restored)

delete a database add this lines to drop.cmd (with allinone, by default it is openpgpwd)

[code]@echo off @net stop openerp-service @set PGPASSWORD=db_password @"absolute_path_to\postgresql\bin\dropdb.exe" -U db_user database_name_to_delete @set PGPASSWORD= @net start openerp-service pause[/code]

variables db_user db_password are this of path_to\server\openerp-server.conf

2) manually with graphic interface pgadmin III (thanks to JuanjoA to remember that) open pgadmin III (start->programs->postgresql->pgadmin II), click on servers-postgresql (on the high left), password asked is db_password in your installed server\openerp-server.conf (with allinone, by default it is openpgpwd) right click on database you want use option you want : drop, backup, restore

3) automatic job (backup), with pgagent (integrated in pgadmin III) : read documentation : http://www.postgresonline.com/journal/archives/19-Setting-up-PgAgent-and-Doing-Scheduled-Backups.html

for users vista and 7 only : (should not work on xp because new command mklink which computes symbolic link for windows doesn't work on xp, sorry!) :

use symlink used in bzr_set.py to have symbolic link for addons in script with automatic update :

install jaraco.windows to have symlink works in py2.5 with bazaar (should work for 2.6 and higher) : open a windows console and tape : easy_install jaraco.windows a second time to be sure there is no errors (strange message appears and cleared the first time) files jaraco.windows-1.8-py2.5.egg, jaraco.util-3.1-py2.5.eg, ...., are installed in site-packages but this package doesn't work on python 2.5 then : edit site-packages\easy-install.pth, delete line : ./jaraco.windows-1.8-py2.5.egg delete file jaraco.windows-1.8-py2.5.egg download corrected lib by myself for python 2.5 of package jaraco and cbprint.py, extract directly in site-packages : http://dl.free.fr/getfile.pl?file=/oyt262ZC

for info steps to correct package jaraco.windows for python 2.5: https://bugs.launchpad.net/bzr/+bug/81689?comments=all

in bzr_set.py add line in the head of file : __import__('jaraco.windows.filesystem').windows.filesystem.patch_os_module()

keep your bazar repositery (do not copy addons in server\bin\addons, and don't replace in repository 'addons' by 'server\bin\addons') bzr_repository = { 'server': (BASEURL + '~openerp/openobject-server/' + version, True), 'client': (BASEURL + '~openerp/openobject-client/' + version, True), 'addons': (BASEURL + '~openerp/openobject-addons/' + version, True), 'extra-addons': (BASEURL + '~openerp-commiter/openobject-addons/' + extraversion + '-extra-addons', False), 'client-web': (BASEURL + '~openerp/openobject-client-web/' + webversion, True),

symlink should work now in script bzr_set.py

this method could be used to add extra addons automatically too, or others branchs, I think you should add the line in bzr_link : bzr_links = { 'addons\': 'server\bin\addons', 'extra-addons\': 'server\bin\addons', ......... } but warning, verify if there not modules which have the same name : to test if you need it.

a little script to delete file, folder and registry key which are not deleted after uninstall allinone (if you had an error during utilisation of openerp, some other keys can be undeleted), tested with version 5.0.14 with windows vista (older version should be ok too).

you must create a del-openerp.bat file, and add this lines in it : [code] ::start script :: Disabled/Enable echoing @echo off

rmdir /S /Q C:\Users\openpgsvc rmdir /S /Q C:\Users\Administrateur\AppData\Roaming\postgresql del /F C:\Users\Administrateur.openerprc del /F C:\Users\Administrateur\openerp-client.log reg delete "HKLM\SOFTWARE\OpenERP All In One" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\Eventlog\Application\openerp-service" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\Eventlog\Application\openerp-web" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\openerp-service" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\openerp-web" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\Eventlog\Application\pgAgent" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\Eventlog\Application\PostgreSQL" /f reg delete "HKLM\SYSTEM\ControlSet011\Services\pgsql-8.3" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Client" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Server" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Web" /f

pause ::end script[/code]

run the .bat script in command line (go to the path where your file is stored, tape the complete name.bat, tape "enter") or right clic on the file "execute as"

add to the script (vista): reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Client" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Server" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Web" /f

can be written in setup.nsi which build allinone in section "ADD YOUR OWN FILES HERE ...": RMDIR /r "C:\Users\openpgsvc " RMDIR /r "C:\Users\Administrateur\AppData\Roaming\postgresql" DELETE "C:\Users\Administrateur.openerprc" DELETE "C:\Users\Administrateur\openerp-client.log" DeleteRegKey HKLM "SOFTWARE\OpenERP All In One" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\Eventlog\Application\openerp-service" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\Eventlog\Application\openerp-web" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\openerp-service" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\openerp-web" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\Eventlog\Application\pgAgent" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\Eventlog\Application\PostgreSQL" DeleteRegKey HKLM "SYSTEM\ControlSet011\Services\pgsql-8.3" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Client" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Server" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\OpenERP Web"

add clean of the C:\WINDOWS\Prefetch folder to clean (files postgresql) after uninstall openerp. (thanks to Ruals)

If like me you have vista (perhaps for seven too), you have no icon for shortcut on desktop, or in list of programs (even for stop/start server). It's due to the fact vista use icon with png format, and xp ico format. I tried to use a png to build for icon but py2exe doesn't support it. Then it exists an other solution, add in files setup.nsi the path to display icons for all shortcut (but always no icon for executables)

in server\pixmaps open openerp-icon.png with by example program xnview (or other program which can generate a .ico format), and save in the same path with name openerp-service.ico (choose in the list ico format). copy this new file and paste it in client-web\win32\pixmaps.

You can modify this for v5 and v6.

for client\setup.nsi :

add text in green color to this lines CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenERP Client.lnk" "$INSTDIR\openerp-client.exe"[color=#00FF00] "" "$INSTDIR\pixmaps\openerp-icon.ico"[/color] CreateShortCut "$DESKTOP\OpenERP Client.lnk" "$INSTDIR\openerp-client.exe"[color=#00FF00] "" "$INSTDIR\pixmaps\openerp-icon.ico"[/color]

for server\setup.nsi: in : Section "OpenERP Server" SecOpenERPServer nsExec::Exec "net stop openerp-service" sleep 2

SetOutPath "$INSTDIR"

add lines (because folder pixmaps and icons are not imported with py2exe) : File /r "pixmaps\openerp-icon.ico" File /r "pixmaps\openerp-service.ico"

add green text to this lines CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenERP Server.lnk" "$INSTDIR\openerp-server.exe"[color=#00FF00] "" "$INSTDIR\openerp-icon.ico"[/color] CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start service.lnk" "$INSTDIR\service\start.bat"[color=#00FF00] "" "$INSTDIR\openerp-service.ico"[/color] CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop service.lnk" "$INSTDIR\service\stop.bat"[color=#00FF00] "" "$INSTDIR\openerp-service.ico"[/color]

for client-web\win32\setup.nsi : in : Section "OpenERP Web" SecOpenERPWeb nsExec::Exec "net stop openerp-web" sleep 2 add lines : SetOutPath "$INSTDIR" File /r "pixmaps\openerp-service.ico"

ad text in green color CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Start OpenERP Web.lnk" "$INSTDIR\bin\start.bat"[color=#00FF00] "" "$INSTDIR\openerp-service.ico"[/color] CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Stop OpenERP Web.lnk" "$INSTDIR\bin\stop.bat"[color=#00FF00] "" "$INSTDIR\openerp-service.ico"[/color]

openoffice in headless mode with command : "C:\Program Files\OpenOffice.org 3\program\soffice.exe" -nologo -nofirststartwizard -headless -norestore -invisible "-accept=socket,host=localhost,port=8100,tcpNoDelay=1;urp;" &

Dear GEM, please avoid copy/pasting unedited post from the old forum, this is a new platform with different semantics. For starters, your questions are not questions. You might want to post them as real questions and answer them yourself, but again - copy/pasting unedited content is not acceptable. Please read the FAQ

Olivier Dony (odo)
on 3/19/13, 7:03 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/10/13, 11:26 AM
Seen: 1589 times
Last updated: 3/27/15, 12:59 PM