~jfb-tempo-consulting/unifield-wm/packaging_py27_US-3833

« back to all changes in this revision

Viewing changes to windows/setup.nsi

  • Committer: Jeff Allen
  • Date: 2017-06-27 14:26:16 UTC
  • Revision ID: jeff.allen@geneva.msf.org-20170627142616-bp9pdad2bxhivayn
Remove version from the Postgres install dir

update.py will manage the two install dirs itself during major
upgrades. Using a version-less install directory simplifies
minor upgrades and prevents us from needing to edit the
service entry while doing a major upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
    WriteIniStr "$INSTDIR\Server\openerp-server.conf" "options" "db_port" $TextPostgreSQLPort
287
287
    WriteIniStr "$INSTDIR\Server\openerp-server.conf" "options" "db_maxconn" 95
288
288
    # Always override pg_path by the correct instance choosen by the user (newly installed or not...)
289
 
    WriteIniStr "$INSTDIR\Server\openerp-server.conf" "options" "pg_path" "$INSTDIR\${PG_DIR}\bin"
 
289
    WriteIniStr "$INSTDIR\Server\openerp-server.conf" "options" "pg_path" "$INSTDIR\pgsql\bin"
290
290
 
291
291
    Push $R1
292
292
    ${Base64_Encode} "$TextOPENERPPWD"
315
315
    nsExec::Exec 'net user openpgsvc /delete'
316
316
 
317
317
    SetOutPath "$INSTDIR"
318
 
    File /r "${PG_DIR}"
 
318
    File /r "pgsql"
319
319
 
320
320
    # Put the db admin user password into a file so that initdb can find it.
321
321
    GetTempFileName $0
325
325
 
326
326
    # Init the DB
327
327
    Rmdir /r "$TextPostgreSQLInstPath"
328
 
    nsExec::ExecToLog '${PG_DIR}\bin\initdb --pwfile "$0" \
 
328
    nsExec::ExecToLog 'pgsql\bin\initdb --pwfile "$0" \
329
329
        -U "$TextPostgreSQLUsername" \
330
330
        --locale="English_United States" -E UTF8 \
331
331
        "$TextPostgreSQLInstPath"'
335
335
    nsExec::Exec 'net user openpgsvc 0p3npgsvcPWD /add'
336
336
    SimpleSC::GrantServiceLogonPrivilege openpgsvc
337
337
    nsExec::ExecToLog 'icacls "$TextPostgreSQLInstPath" /c /t /grant openpgsvc:F'
338
 
    nsExec::ExecToLog '${PG_DIR}\bin\pg_ctl register -N Postgres \
 
338
    nsExec::ExecToLog 'pgsql\bin\pg_ctl register -N Postgres \
339
339
        -U openpgsvc -P 0p3npgsvcPWD -D "$TextPostgreSQLInstPath"'
340
340
 
341
341
    # Edit the postgresql.conf to limit listening and set port.
409
409
    nsExec::Exec 'sc stop Postgres'
410
410
    nsExec::Exec 'sc delete Postgres'
411
411
    nsExec::Exec 'net user openpgsvc /delete'
412
 
    Rmdir /r "$INSTDIR/${PG_DIR}"
 
412
    Rmdir /r "$INSTDIR/pgsql"
413
413
 
414
414
    DeleteRegKey HKLM "${UNINSTALL_REGISTRY_KEY}"
415
415
SectionEnd