Skip to content

Latest commit

 

History

History
193 lines (154 loc) · 8.87 KB

File metadata and controls

193 lines (154 loc) · 8.87 KB

#summary How to install Tryton Client and server on Windows #labels Phase-Deploy

Installing the Client

The best way for installing the Tryton client on Window$ is: download the client from the download page. There you find a self-contained package and nothing to worry about.

Installing the Server

(works for Win$ 7 and tryton 3.4)

Download required packages

Change the clock to UTC

(source 1; source 2)

  1. Start the Registry Editor (run regedit from start menu)
  2. Look for the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  3. Create a dword named RealTimeIsUniversal and set the value to 1
  4. Restart your computer
  5. Open time and date settings
  6. Change to UTC

Install PostgreSQL

  • Double-click on the MSI or EXE file of PostgreSQL
  • Select the following optiions
    • pgAgent
    • pgBouncer
    • Apache/PHP
    • phpPgAdmin
  • Make sure to set and remember a safe password
  • Allow strange characters by adding the following line in postgresql.conf (source; optional?): bytea_output == 'escape'
  • Restart the server
    • Go to Start Menu --> PostgreSQL --> Reload configuration

Install 7-zip (or equivalent) and LibreOffice

This guide was prepared using LibreOffice 4.3 Double click the EXE or MSI files

Install Python

  • Install Python (double click EXE or MSI files)
  • Add a variable called PythonPath to the environment
    • META KEY + PAUSE --> Advanced system configuration --> Environment variables --> New
    • Set the value to C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Scripts;C:\Python27\DLLs
    • (restart?)

Decompress tar.gz and zip files

(It is convenient to decompress to the same directory)

  1. Go to the download folder
  2. select all the tar.gz files
  3. Right click on the files
  4. 7-zip --> Extract here * If a dist directory is created, open it. 1. Select all tar files 1. Right click on the files 1. 7-zip --> Extract here
  • You should end up with a list of folders with the names of the packages to install
  1. Go to the download folder again
  2. Right click on the zip files
  3. Extract files to dist directory

Start a Window$ console as administrator

Start menu --> Accesories --> Right click on System console --> Run as administrator

Make sure to have vcvarsall.bat

(source)
Install Visual Studio C++ to fix error: Unable to find vcvarsall.bat

SQL express is not necessary

Install packages

For each package, go to their directory (Ex: cd C:\TrytDwn\dist<package>) and install by typing (python setup.py install, unless otherwise noted)

  • python-dateutil
  • python-sql
  • simplejson
  • cdecimal
  • Pycparser
  • bcrypt
  • cffi
  • psycopg 2 with the win32 EXE
  • GooCalendar
  • lxml with pip install lxml in the console
  • relatorio
  • polib
  • tryton server (trytond)
  • (tryton) with the EXE (tryton-setup-last.exe)

Create a tryton user in PostgreSQL

Open the PostgreSQL server on pgAdmin III

  • Start menu --> PostgreSQL --> pgAdmin III --> Double click on the PostgreSQL server (below Servers) --> Type password --> Create a role for tryton
  • Right click on Login Roles --> New login role
    • Set role for your tryton database user
      • Set role name
      • Set and remember a safe password for the
        • Role Privileges
          • Can login
          • Inherits rights
          • NO superuser
          • Can create databases
          • NO create roles
          • NO initiate streaming replication and backups

Create a test database

  • Open the PostgreSQL server on pgAdmin III
  • Create a new database for which tryton is the owner
    • Right click on Database --> New Database -->
      • Set the name of the database
      • Pick your as owner
        After creating the user and database, you can close pgAdmin III

Create trytond.conf

  • Get the encrypted version of the password:
    • Run the following command in a console:
    python -c 'import getpass,fcrypt,random,string; print fcrypt.crypt(getpass.getpass(), "".join(random.sample(string.ascii_letters + string.digits, 8)))'
    • Copy the resulting code
  • Open a notepad window
  • Paste the following (replace passwords):
    [jsonrpc]
    listen == localhost:8000
    hostname == localhost

    [database]
    uri == postgresql://tryton:<tryton password in pgAdmin>@localhost:5432/

    [session]
    timeout == 600
    super_pwd == << CTRL + V (to paste the resulting code of password) >>

    [report]
    unoconv == "C:\Program Files\LibreOffice 4\program\python.exe" unoconv
  • Save as trytond.conf in a directory (preferably the c:\python27\scripts)

Install LibreOffice

Double click on the MSI installer (check that the installation directory is the same as the one in the line of unoconv in trytond.conf)

Initialise database

(source)
Type the following in a console:

python <path to Python scripts> -c <path to trytond.conf> -d <name of database> --all
Ex: pytyon c:\Python27\Scripts\trytond -c c:\Python27\Scripts\trytond.conf -d test --all Set and remember a password for the admin user of the database (it can be different than the password of the tryton user set before)

Run tryton server (trytond)

Type the following in a console:

pytyon <path to Python scripts> -c <path to trytond.conf>
Ex: pytyon c:\Python27\Scripts\trytond -c c:\Python27\Scripts\trytond.conf}

Run tryton client (tryton)

In the openning window, set the server to localhost:8000 (that is, server localhost and port 8000), the user to admin and password to the one used when the database was initialised.