Scripts (optional)
Last updated
Was this helpful?
Last updated
Was this helpful?
Applies to: Patch My PC Cloud
The Scripts tool (optional) of the Patch My PC (PMPC) Cloud deployment wizard allows you to configure settings for install and uninstall scripts.
Note
Scripts will be run in the same context as the application.
Each install script is limited to 1 MB per script, with a total size limit of 4 MB for all scripts.
There is a limit of 50,000 characters per script.
We currently support the following script types:
.BAT
.CMD
.PS1
.VBS
Important
Currently, scripts containing "${env:ProgramFiles(x86)}"
or "${env:ProgramFiles}"
cannot be uploaded as Cloudflare is falsely identifying them as a false positive related to Log4j exploits. We are actively working with them to resolve this, but as this is outside our control, we cannot provide an estimated resolution time.
To work around this issue, see the Resolution section of "TypeError: Failed to fetch" error when trying to upload a Pre or Post Script.
To add a script:
Click the Scripts tab to expose the configurable settings.
Click Add beside the relevant script option to add a script, then configure the required settings in the relevant sections as detailed below.
Pre-Install Script - a script that can be run before the installer runs.
Post-Install Script - a script that can be run after the installer runs.
Pre-Uninstall Script - a script that can be run before the uninstaller runs.
Post-Uninstall Script - a script that can be run after the uninstaller runs.
To add a Pre-Install script:
Click Add beside the Pre-Install option.
To import an existing script, click Import then browse to the location containing the script and select it.
The Add Pre-Install Script page is populated with the imported script.
To manually add a script, enter a unique name for the script in the Script Name field.
Select the type of script from the Script Format dropdown.
In the script editor, type your script.
Note
We currently have a limit of 50,000 characters per script. Use the Number of characters used counter to keep track of the number of characters you’ve entered in the script editor.
In the Arguments field, enter any arguments you want to provide to the script.
Tip
You can use variable names as arguments, provided they are enclosed by percentage signs (%
). We provide common variables under this field, which you can add by clicking the plus (+) symbol or relevant variable name.
Important
Using script Arguments is currently unsupported when deploying an app to macOS.
Check the Don’t attempt software update if the pre script returns an exit code other than 0 or 3010 checkbox if you don’t want the app to be installed if the pre-script returns an exit code other than 0 or 3010.
If you do not check this checkbox, we will attempt to install the app regardless of the exit code returned by the pre-install script.
Check the Run the pre-update script before performing any auto-close or skip process checks checkbox if you want to run the pre-install script before the conflicting process notification is displayed (if relevant). If you do not check this checkbox, we will run the pre-install script after the conflicting process notification.
Click Save to save your script.
The Configurations tab is re-displayed with the name of the configured script beside it.
Tip
You can click Edit to edit a script or its settings. You can also click the red “x
” beside a script to delete it.
To add a Post-Install script:
Click Add beside the Post-Install option.
To import an existing script, click Import, browse to the location containing the script, and select it.
The Add Post-Install Script page is populated with the imported script.
To manually add a script, enter a unique name for the script in the Script Name field.
Select the type of script from the Script Format dropdown.
In the script editor, type your script.
Note
We currently have a limit of 50,000 characters per script. Use the Number of characters used counter to keep track of the number of characters you’ve entered in the script editor.
In the Arguments field, enter any arguments you want to provide to the script.
Tip
You can use variable names as arguments, provided they are enclosed by percentage signs (%
). We provide common variables under this field, which you can add by clicking the plus (+
) symbol or relevant variable name.
%ReturnCode%
is currently only supported on post-scripts.
Important
Using script Arguments is currently unsupported when deploying an app to macOS.
Click Save to save your script.
The Configurations tab is re-displayed with the name of the configured script beside it.
Tip
You can click Edit to edit a script or its settings. You can also click the red “x
” beside a script to delete it.
To add a Pre-Uninstall script:
Click Add beside the Pre-Uninstall option.
To import an existing script, click Import then browse to the location containing the script and select it.
The Add Pre-Uninstall Script page is populated with the imported script.
To manually add a script, enter a unique name for the script in the Script Name field.
Select the type of script from the Script Format dropdown.
In the script editor, type your script.
Note
We currently have a limit of 50,000 characters per script. Use the Number of characters used counter to keep track of the number of characters you’ve entered in the script editor.
In the Arguments field, enter any arguments you want to provide to the script.
Tip
You can use variable names as arguments, provided they are enclosed by percentage signs (%
). We provide common variables under this field, which you can add by clicking the plus (+
) symbol or relevant variable name.
Important
Using script Arguments is currently unsupported when deploying an app to macOS.
Check the Don’t attempt software uninstall if the pre script returns an exit code other than 0 or 3010 checkbox if you don’t want the app to be uninstalled if the pre-script returns an exit code other than 0 or 3010. If you do not check this checkbox, we will attempt to uninstall the app regardless of the exit code returned by the pre-install script.
Check the Run the pre-uninstall script before performing any auto-close or skip process checks checkbox if you want to run the pre-uninstall script before the conflicting process notification is displayed (if relevant). If you do not check this checkbox, we will run the pre-uninstall script after the conflicting process notification.
Click Save to save your script.
The Configurations tab is re-displayed with the name of the configured script beside it.
Tip
You can click Edit to edit a script or its settings. You can also click the red “x
” beside a script to delete it.
To add a Post-Uninstall script:
Click Add beside the Post-Uninstall option.
To import an existing script, click Import then browse to the location containing the script and select it.
The Add Post-Uninstall Scripts page is populated with the imported script.
To manually add a script, enter a unique name for the script in the Script Name field.
Select the type of script from the Script Format dropdown.
In the script editor, type your script.
Note
We currently have a limit of 50,000 characters per script. Use the Number of characters used counter to keep track of the number of characters you’ve entered in the script editor.
In the Arguments field, enter any arguments you want to provide to the script.
Tip
You can use variable names as arguments, provided they are enclosed by percentage signs (%
). We provide common variables under this field, which you can add by clicking the plus (+
) symbol or relevant variable name.
%ReturnCode%
is currently only supported on post-scripts.
Important
Using script Arguments is currently unsupported when deploying an app to macOS.
Click Save to save your script.
The Configurations tab is re-displayed with the name of the configured script beside it.
Tip
You can click Edit to edit a script or its settings. You can also click the red “x
” beside a script to delete it.
If you do not want to configure any of the optional tabs under the Tools section, click Next to move to the Assignments tab.
Otherwise, click on the relevant tab under Tools to configure the required settings, which are explained in the relevant article.