• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Variables in Modify Command Line Right-Click Customization

Started by ekraus, March 06, 2025, 08:29:46 AM

Previous topic - Next topic

ekraus

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.

Michael (Patch My PC)

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.

ekraus

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