galevsky
13th November 2007 16:44 UTC
ExecWait on .msi file for silent install
Any idea why my function doesn't work with Acrobat Reader v7.0.9 installer ?
I use a function
###################
# InstallQuietMSI #
###################
# MSI Installer launcher in quiet mode
#
# Inputs:
# - Stack Top -
# 0: installer executable
# 1: installer path
#
# Returns:
# - Stack Top -
# 0: installation returned code
##
Function InstallQuietMSI
Exch $R0
Exch
Exch $R1
Push $0
setOutPath "$SYSDIR"
MessageBox MB_OK 'MSI: "$R1\$R0" /quiet /norestart'
ExecWait '"$R1\$R0" /quiet /norestart' $0
MessageBox MB_OK "RC: $0"
Exch $0
Exch 2
Pop $R1
Pop $R0
FunctionEnd
At runtime, trying to install both jre_v1.5 and Acrobat Reader v7.0.9:
> Execute: "ressources\tools\Adobe\en\adobe.msi" /qb
(the returned code $0 is not set at all (contains previous value))
> Execute: "ressources\tools\JRE\jre-1_5_0_11-windows-i586-p.exe" /qb
(the returned code is 0, everything run well and install is process)
I tried to do that in a shell window (from the dir containing the setup.exe):
> C:\Documents and Settings\galevsky\Desktop\validation\"ressources\tools\Adobe\fr\adobe.msi" /quiet
and it works pretty good. The adobe.msi file (with a Data1.cab one) was picked up into INSTDIR\Setup Files\ of Acrobat Reader v7.
So, what is wrong ? Is there any strange behaviour with ExecWait ? I tried a "msiexec" /i path\adobe.msi but same behaviour happened...
Thks for your help,
Gal'
Afrow UK
13th November 2007 19:24 UTC
If it's a .msi then you should execute it with msiexec.exe or ExecShell.
Stu
galevsky
13th November 2007 19:58 UTC
msiexec is not better but I will try ExecShell...
Gal'
Afrow UK
13th November 2007 20:50 UTC
You won't be able to get an exit code with ExecShell, so you'd need to use msiexec.exe for that.
Stu
galevsky
13th November 2007 21:23 UTC
I just do:
> Execute: msiexec /i "ressources\tools\Mysql\mysql_server_v5.0.45.msi" and it fails on RC=1619 !!!
I am sure the path is good....
Gal'
Afrow UK
13th November 2007 21:28 UTC
Firstly it's resources and not ressources, but either way try not to use relative paths. That would be executed relative to what path is set with SetOutPath. Use a full path to be safe.
Stu
galevsky
13th November 2007 21:31 UTC
I read that this error comes from rights problem, so I decided to
> CopyFile "path\mysql_server_v5.0.45.msi" "$TEMP\mysql_server_v5.0.45.msi"
> Execute: msiexec /i "$TEMP\mysql_server_v5.0.45.msi"
... but failed also. Same error. :(
Gal'
kichik
13th November 2007 21:32 UTC
1619 is ERROR_INSTALL_PACKAGE_OPEN_FAILED which suggests what Afrow has already said - msiexec.exe can't find the MSI file form the path you gave it.
galevsky
13th November 2007 21:34 UTC
Originally posted by Afrow UK
Firstly it's resources and not ressources, but either way try not to use relative paths. That would be executed relative to what path is set with SetOutPath. Use a full path to be safe.
Stu
Yep mixing both french and eng. I am having a try with absolute path...
Thks ;)
Gal'
galevsky
13th November 2007 21:35 UTC
Same error....
kichik
13th November 2007 21:43 UTC
1619's text is:
# This installation package could not be opened. Verify that
# the package exists and that you can access it, or contact
# the application vendor to verify that this is a valid
# Windows Installer package.
So if the path really is valid, it might be a corrupted MSI. Does it work when you double click it?
galevsky
13th November 2007 21:54 UTC
Oups, I made a type during the try with the absolute path: absolute path fix my problem with mysql.msi. I will now check for acrobat_reader.msi.
Gal'
galevsky
13th November 2007 22:23 UTC
Fixed !!!!!!
Many thanks, guys, the key is using absolute path.
Gal'