RichardEgenas
RichardEgenas

Reputation: 1

CustomAction and MSI Properties ignored when deploying through Intune

I have a weird scenario where I have a C# Windows Forms app and a setup Project that builds an MSI in VS 2015.

In the Windows Forms Project I've created and setup the InstallerClass.cs properly, in the setup project I've configured an Install Custom Action and set the CustomActionData to: /CODE="[CODE]" /GROUP="[GROUP]", and InstallerClass property is set to true.

And when running the installer in a command prompt with: "msiexec /i /qb myapp.msi /COMPANYCODE=12345 /GROUP=Test" it works perfectly, I can in the Install function of the InstallerClass get the COMPANYCODE and GROUP properties and they are populated with 12345 and Test. And then in the Installer function I can use these values and perform custom actions as needed (in this case write it down for later use).

BUT, when I deploy the msi through Microsoft Intune the arguments are TOTALLY ignored and are null in the Install function of the InstallClass... do you have any tips on this?

I can see the CustomAction table in the MSI when opening with Orca: Orca table view picture Thanks a lot in advance!

Best Regards, Richard

Upvotes: 0

Views: 1016

Answers (3)

LV LXL
LV LXL

Reputation: 1

I had the same problem as you. After many investigations, I found that the reason was that the file path deployed by Intune cannot be relative or obtained by calling a method, as shown in

$installDir =[System.Environment]::GetFolderPath('MyDocuments') // ×
$installDir = "C:\Users\kdan\Documents" // √

Actually the parameters are received.

Upvotes: 0

PhilDW
PhilDW

Reputation: 20790

The issue is likely to be that the property values are not being transferred into the execution part of the install because they are not marked secure.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa371571(v=vs.85).aspx

There is no support for this in Visual Studio setups, so you need to edit the MSI file with something like Orca. Go to the Property table and see SecureCustomProperties which will probably be:

SecureCustomProperties PREVIOUSVERSIONSINSTALLED;NEWERPRODUCTFOUND

and you will need to add CODE and GROUP, semi-colon separated.

Upvotes: 0

Michael Urman
Michael Urman

Reputation: 15905

Check a verbose log to be certain, and be aware that I'm taking a stab in the dark because I'm unfamiliar with how Intune launches things, but I would guess you haven't marked the properties CODE and GROUP as Secure="yes" (or maybe COMPANYCODE; your question is conflicted about these). When a property is not secure, then certain scenarios will disallow passing it to the execute sequence. See SecureCustomProperties property for Microsoft's information on this.

Upvotes: 2

Related Questions