0

I'm handling updates for my Office add-in programmatically via my very own PHP script that checks for them, and the WindowsInstaller class in my client application.

The following 2 lines of code with a valid URL sometimes raises exceptions on some of my clients PCs:

String UpdateString = "https://www.example.com/installers/AppInstaller.msi";
Installer.SetInternalUI(InstallUIOptions.Full);
Installer.InstallProduct(UpdateString, "ACTION=INSTALL ALLUSERS=2 MSIINSTALLPERUSER=");

The exception is the following:

Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.

I got the arguments from the post below, and they've been working in a very large number of cases, but there are 1-2 users out of 50 who will bump into this issue on their PC... https://stackoverflow.com/a/12416878/3609107

I suspect there could be a permission related issue for some of the users, although the ALLUSERS=2 statement makes sure, that if the user doesn't have sufficient permissions to install per machine, then it will downgrade to ALLUSERS=1, and install for user (as I understand it from the short documentation i've found for it).

Laureant
  • 979
  • 3
  • 18
  • 47
  • Hmm, why is MSIINSTALLPERUSER= empty? Add true or false – Vladimir Arustamian Jul 18 '17 at 12:44
  • https://msdn.microsoft.com/en-us/library/windows/desktop/dd408007(v=vs.85).aspx you can see in the Remarks that it has to be set to empty string (virtually nothing) to ensure it's not a PERUSER installation. – Laureant Jul 18 '17 at 12:46
  • Is it possible that those few users are with a different OS, MSI version, etc on their system? – pstrjds Jul 18 '17 at 12:48
  • Yes, they can have any Windows OS / MSI version on their machines. Also their permissions (whether they are administrators / network users) is unknown to me. They are on Windows 8.1 Pro, Windows 10 Pro or Windows 10 Enterprise. – Laureant Jul 18 '17 at 12:55

0 Answers0