PDA

View Full Version : How to get commandline inputs?



pbsdis
11-02-2010, 04:44 PM
Hi,

I would like to create a log file to contain some information like when (date & time) the install starts and finishes, what commandline is invoked (e.g. setup.exe /v"bla bla bla")

Is there any existing properties I can use to retrieve the information? I am planning to use VBS.


Thanks

pbsdis
11-02-2010, 05:00 PM
InstallScript project has 'CMDLINE' for that, is there any equivalent for Basic MSI project?

Johannes_T
11-03-2010, 03:44 AM
The documentation states:
"In Basic MSI projects, you can pass public properties through Setup.exe to Msiexec.exe using the /v command-line argument. "

Tim Mayert
03-10-2011, 01:02 PM
But can you get the entire cmdline value?

We have a property in our property table set with a default value and during install we want to check to see if the admin has set that property on the command line. If they did then we will use that value. If it was not passed on the command line then then we use App Search to see if the registry key, that holds this value, has already been set. If it exists we use that value. but if these do not exist then we use the default value.

Now we could have 3 properties:
1. The Admin property that gets pushed in
2. The property that gets set if the key resided in the registry
3. The default property

Then we could have 3 custom actions that will then set the final property that will then get registered.

So we can get rid of some of this if we can simply read the cmdline to see if the property we want is listed on the cmdline and then just use it.

So if we can get the command line then that may help here.

Thanks,

Johannes_T
03-11-2011, 04:16 AM
Hi Tim,
as far as I know (and I googled a lot), you have the following options depending on the project type:

Installscript: Use CMDLINE to acces the whole command line
Installscipt MSI: Pass variables with
setup.exe /z”arg1=value1 arg2=value2 arg3=value3″
Basic MSI: You can only set properties with
setup.exe /v"PROP=DATA"
I don't know of any way to access the whole command line in Basic MSI.

HTH,
Johannes