Hi
The argument "/ INI " needs an absolut path . The subject has been
discussed on the forum:
https://forum.tranquil.it/viewtopic.php?f=9&t=466&start=10#p1193
A solution :
import os
uninstallstring = []
def install():
curentpath = os.path.dirname(os.path.realpath(__file__))
run(r'"Firefox_Setup_45.0.1esr.exe" -ms /INI=%s\file.ini' % curentpath ,timeout=300)
Simon https://blog.lesfourmisduweb.org
Le 17/05/2016 20:23, Denis Cardon a
écrit :
Hi Mariusz,
Le 17/05/2016 20:08, MBP Oświęcim - Informatyk a écrit :
Hi,
I tried to fork tis-firefox-esr and modify setup.py.
I added install.ini file to sources (alongside .exe and other
files).
Content of install.ini file is as below:
| [Install]
| InstallDirectoryName=Firefox
| QuickLaunchShortcut=true
| DesktopShortcut=true
| StartMenuShortcuts=true
| MaintenanceService=false
According to mozilla doc[1], usage should be easy as:
| Firefox_installer.exe /INI=install.ini
So I modified setup.py with following content:
|install_exe_if_needed(exe,silentflags='/INI=install.ini',key=ukey,min_version=version,killbefore='firefox.exe')
when adding /INI=install.ini, you have removed the "-ms" silent
install flag. So probably firefox is waiting somewhere in the
background.
Could you try with:
install_exe_if_needed(exe,silentflags='-ms
/INI=install.ini',key=ukey,min_version=version,killbefore='firefox.exe')
By the way, how are you testing your packages? When you are in
pyscripter (package tis-waptdev), there is a wapt.psproj file
created in the \WAPT subdirectory with preconfigured targets
(install, debug, remove, etc.). Using those targets, you can
easily test and debug install scripts.
Be sure to be local admin and have UAC disabled when building
packages with pyscripter.
Cheers,
Denis
Second parameter is passed as silentflags and it should do it's
job. But
when I try to deploy such package, installation fails with
timeout.
Main part of install function:
|version = control.version.split('-',1)[0]
|ukey = 'Mozilla Firefox %s ESR (x86 pl)'%version
|exe = 'Firefox Setup %sesr.exe'%version
|install_ini = os.path.abspath('install.ini')
|install_exe_if_needed(exe,silentflags='/INI'+install_ini,key=ukey,min_version=version,killbefore='firefox.exe',timeout=30)
And log output looks like[2]:
2016-05-17 20:05:01,052 INFO Status : Downloading
mbp-firefox-esr :
http://wapt.mbp/wapt/mbp-firefox-esr_45.1.1-31_all.wapt :
44515008 /
44515008 (100%) (11336 KB/s)
2016-05-17 20:05:01,052 INFO Status :
2016-05-17 20:05:01,062 INFO Package issued by C=PL,
L=O\xC3\x85\xC2\x9Bwi\xC3\x84\xC2\x99cim, O=MBP
O\xC3\x85\xC2\x9Bwi\xC3\x84\xC2\x99cim, OU=wapt-get,
CN=wapt.mbp/emailAddress=informatyk@mbp-oswiecim.pl
2016-05-17 20:05:01,062 INFO Register start of install
C:\Program
Files\wapt\cache\mbp-firefox-esr_45.1.1-31_all.wapt as user
SYSTEM to
local DB with params {}
2016-05-17 20:05:01,062 INFO Interactive user:SYSTEM, usergroups
None
2016-05-17 20:05:01,163 INFO Status : Installing package
mbp-firefox-esr
version 45.1.1-31 ...
2016-05-17 20:05:01,173 INFO Installing package C:\Program
Files\wapt\cache\mbp-firefox-esr_45.1.1-31_all.wapt
2016-05-17 20:05:01,173 INFO unzipping C:\Program
Files\wapt\cache\mbp-firefox-esr_45.1.1-31_all.wapt to temporary
c:\windows\temp\wapttdmtol
2016-05-17 20:05:01,344 INFO Package issued by C=PL,
L=O\xC3\x85\xC2\x9Bwi\xC3\x84\xC2\x99cim, O=MBP
O\xC3\x85\xC2\x9Bwi\xC3\x84\xC2\x99cim, OU=wapt-get,
CN=wapt.mbp/emailAddress=informatyk@mbp-oswiecim.pl
2016-05-17 20:05:01,444 INFO sourcing install file
c:\windows\temp\wapttdmtol\setup.py
2016-05-17 20:05:01,444 INFO Install parameters : {}
2016-05-17 20:05:01,453 INFO executing install script
2016-05-17 20:05:01,453 INFO Run "(u'"Firefox Setup
45.1.1esr.exe"
/INI="c:\\windows\\temp\\wapttdmtol\\install.ini"',)"
2016-05-17 20:05:07,072 INFO 192.168.0.191 - "GET
/tasks.json?uuid=BACCF0D7-CBD5-324D-84C4-8D9C0014E82D HTTP/1.1"
- 200
113866
2016-05-17 20:05:07,272 INFO (u'"Firefox Setup 45.1.1esr.exe"
/INI="c:\\windows\\temp\\wapttdmtol\\install.ini"',) command
returns code 0
Mozilla Firefox 45.1.1 ESR (x86 pl)
2016-05-17 20:05:07,282 CRITICAL Fatal error in install script:
EWaptSetupException: Fatal error : Setup Firefox Setup
45.1.1esr.exe has
been ran but the uninstall key Mozilla Firefox 45.1.1 ESR (x86
pl) can
not be found:
Traceback (most recent call last):
File "C:\Program Files\wapt\common.py", line 3178, in
install_wapt
exitstatus = setup.install()
File "c:\windows\temp\wapttdmtol\setup.py", line 84, in
install
install_exe_if_needed(exe,silentflags='/INI='+'"'+install_ini+'"',key=ukey,min_version=version,killbefore='firefox.exe')
File "c:\windows\temp\wapttdmtol\setup.py", line 68, in
install_exe_if_needed
error('Setup %s has been ran but the uninstall key %s can
not be
found' % (exe,key))
File "C:\Program Files\wapt\setuphelpers.py", line 3437, in
error
raise EWaptSetupException(u'Fatal error : %s' % reason)
EWaptSetupException: Fatal error : Setup Firefox Setup
45.1.1esr.exe has
been ran but the uninstall key Mozilla Firefox 45.1.1 ESR (x86
pl) can
not be found
2016-05-17 20:05:07,441 INFO Status :
2016-05-17 20:05:07,441 CRITICAL Package mbp-firefox-esr
(=45.1.1-31)
not installed due to errors : EWaptSetupException: Fatal error :
Setup
Firefox Setup 45.1.1esr.exe has been ran but the uninstall key
Mozilla
Firefox 45.1.1 ESR (x86 pl) can not be found
2016-05-17 20:05:07,441 CRITICAL Exception: Error during install
of
mbp-firefox-esr (=45.1.1-31): errors in packages mbp-firefox-esr
2016-05-17 20:05:07,453 INFO Status : Done: Update packages
installed on
host
Any ideas what I'm doing wrong?
[1] - https://wiki.mozilla.org/Installer:Command_Line_Arguments
[2] - http://wklej.org/hash/2e439fdd419/