PDA

View Full Version : Silent installation problem reading Session variables from ini file


yafitmayo
06-11-2009, 04:07 AM
My Setup Factory program, I'm running a msi file with command line parameters. Some of the parameters are session variables:
1. %AppFolder%
2. %LangId% (custom session variable)
File.Run("msiexec", "/i \"" .. myMsi .. "\" /passive /norestart ET_LANG_ID=\"" .. SessionVar.Get("%LangId%") .. "\" TARGETDIR=\"" .. SessionVar.Get("%%AppFolder%%") .. "\"", "", "", true);

When I'm running my Setup Factory program in silent mode with an ini file, it seems like the session variables are not read from this file. When I looked at the msi log created, it says:
"Could not access network location %ProgramFilesFolder%\Product Name."

I'm running my program, in silent mode as followed:
MyProg.exe "/S:SetupVar.ini"

Ini file:
[SetupValues]
%AppFolder%=C:\Program Files\Product Name
%LangId%=en

jassing
06-11-2009, 08:17 AM
Don't use double %'s.

yafitmayo
06-21-2009, 12:26 AM
I'm not. I wrote it by mistake.
This is the correct line:
File.Run("msiexec", "/i \"" .. myMsi .. "\" /passive /norestart ET_LANG_ID=\"" .. SessionVar.Get("%LangIdPki%") .. "\" TARGETDIR=\"" .. SessionVar.Get("%AppFolder%") .. "\"", "", "", true);

jassing
06-21-2009, 10:30 AM
so you've debugged it enough to know what LangIdPk and AppFolder are, and running that same line from the command line works?

yafitmayo
06-22-2009, 03:17 AM
Yaap. When running this from command line it works.

When running in silent mode, I saw that these variables get the default value set in Setup factory environment (and not the value from the ini file).

jassing
06-22-2009, 10:59 AM
Post your project & ini file(s) and the exact command line you are using...