Support Forum: Get Support for Patch My PC Products and Services

Microsoft Configuration Manager and Intune (Enterprises/Paid) => Support and General Questions (Enterprises Using ConfigMgr and Intune) => Topic started by: ekraus on March 06, 2025, 08:29:46 AM

Title: Variables in Modify Command Line Right-Click Customization
Post by: ekraus on March 06, 2025, 08:29:46 AM
Is it possible to use package-specific variables in the Modify Command Line right-click customization like it is in the Choose Custom Pre/Post Script(s)? For example, if I was adding a log argument and wanted to call the specific version being installed, could I do something like /log C:\Windows\Logs\Example_%Version%.log?

I have done some tests, and I see %version% when the command-line is checked for placeholders and environment variables, but it does not survive expansion.
Title: Re: Variables in Modify Command Line Right-Click Customization
Post by: Michael (Patch My PC) on March 06, 2025, 09:24:38 AM
This was just added to version 2.1.33.0 of the publisher. See the release notes below.

https://docs.patchmypc.com/release-history/production-releases

If your App/Update is already published, you will want to ensure you 'Republish' it so that the scriptrunner is updated to the latest version and supports.
Title: Re: Variables in Modify Command Line Right-Click Customization
Post by: ekraus on March 06, 2025, 10:06:28 AM
I have confirmed that we're on version 2.1.33.0. This is for an application that I lit up yesterday and have republished. I do not see that %VERSION% is being expanded and the resulting log that is generated does not have it in the name. The string I've added to modify the command line is /smur /msi TRANSFORMS=AcroPro.mst /L*v! C:\Windows\Logs\Adobe_Acrobat_x64_%VERSION%.log. Here are the relevant excerpts from the PatchMyPC-ScriptRunner.log:

Expanding placeholder variables in: /smur /msi TRANSFORMS="C:\WINDOWS\ccmcache\32\AcroPro.mst" /L*v! C:\Windows\Logs\Adobe_Acrobat_x64_%VERSION%.log
New input after replacing placeholders: /smur /msi TRANSFORMS="C:\WINDOWS\ccmcache\32\AcroPro.mst" /L*v! C:\Windows\Logs\Adobe_Acrobat_x64_.log