2

I'm wondering if there is an option to obtain msiexec command line at "install" custom action (we use vs2008 "setup project" for the installer).

We know that we can access "CustomActionData" parameters but if we run the following command:

msiexec /i demo.msi /quiet user=test log=true

we know how to access "CustomActionData" parameters (user=test log=true), but we don't know how to access whole msiexec command line parameters (including "/i /quiet")...

Is it even possible because in Process Monitor we can see that at install action, this msiexec process (running as SYSTEM) is run with command the following command:

C:\Windows\system32\MsiExec.exe -Embedding 3E439F7DA7DE174205150FEBCEB7B14F E Global\MSI0000

So, is it possible to obtain "msiexec" command line parameters inside the installer (c++) code?

user3227617
  • 41
  • 1
  • 4
  • What are you trying to determine? [This might be somewhat related, though not what you asked](https://stackoverflow.com/a/50455886/129130), maybe have a look (it is about using the MSI log file to determine the `msiexec.exe` command line). [Sample from log file](https://stackoverflow.com/a/54769767/129130) (a bit down the page). And [MSI logging summary](https://stackoverflow.com/a/54458890/129130). – Stein Åsmul Dec 19 '19 at 03:38
  • We would like to determine how (with which command line) our installer was run? If a use ran "msiexec /i demo.msi /quiet user=test dep=sec", we would like to detect the whole line at "install" entry point in our installer source code... – user3227617 Dec 19 '19 at 07:13
  • Yes, I thought as much, but we need to know what the purpose is? There are MSI conditional logic that you can used to determine what installation context you are in, but it all depends on the purpose - what you are trying to do. – Stein Åsmul Dec 20 '19 at 18:59
  • Stein, as already said, we just want to obtain the msiexec cmd parameters, that was launched for (un)installing the product... We are already using the "CustomActionData" property to support some custom parameters, but we want to obtain whole msiexec command line... Is there some similar MsiPropertyGet() function which could print whole msiexec command line (at install/uninstall entry point)? – user3227617 Dec 23 '19 at 13:35

0 Answers0