# Use Patch My PC Scripts in a Patch My PC Cloud Deployment

*Applies to: Patch My PC Cloud*

{% hint style="danger" %}
**Important**

This documentation is for a pre-release feature still under development and, therefore, incomplete. As a result, both functionality and documentation are subject to change.

Once this feature is released, it will be announced and this banner removed.
{% endhint %}

For certain applications in the Patch My PC (PMPC) App Catalog, we include scripts to enhance the installation and configuration of the app, based on our experience. By default, if an app includes one of our recommended scripts, these are automatically executed at the time the app is installed.

However, this default behavior can cause issues for some customers who are not aware of the scripts and their contents.

To give you better visibility and to allow you to customize the deployment process, for those apps that include our recommended scripts, you will now see the **Customer Scripts | PMPC Scripts** toggle on the **Scripts** tool page of the **Configurations** tab of the PMPC Cloud Deployment Wizard.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FzrFSvyI4fmqZfQUxbenU%2Fimage.png?alt=media&#x26;token=8d45f0e6-5d9d-476f-a978-21aa63369075" alt="“Customer Scripts | PMPC Scripts” toggle" width="563"><figcaption></figcaption></figure>

Contrast this to an app that does not include any recommended scripts.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FsUhYOXxnW8V4vbCgOZSO%2Fimage.png?alt=media&#x26;token=fe675ee2-5690-41d4-9748-ccdbfc6f1e5c" alt="App without the “Customer Scripts | PMPC Scripts” toggle" width="563"><figcaption></figcaption></figure>

Using this feature allows you to:

* [View PMPC Scripts](#viewing-pmpc-scripts)
* [Disable a PMPC Script](#disable-a-pmpc-script)
* [Enable a PMPC Script](#enable-a-pmpc-script)

## View PMPC Scripts

To view the PMPC scripts, click the PMPC Scripts toggle.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FckkcYTZnNQQD36yYtAY9%2Fimage.png?alt=media&#x26;token=85b3acf4-4413-4d26-87e1-e974ea1a0da8" alt="Clicking “PMPC Scripts”" width="563"><figcaption></figcaption></figure>

Any recommended scripts included with the app are shown.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2F8CdsR2ZaMzxYlkzsqYOM%2Fimage.png?alt=media&#x26;token=d722c784-64a0-469d-a78b-650f68d1a86c" alt="Recommended PMPC Scripts" width="563"><figcaption></figcaption></figure>

Once you have clicked PMPC Scripts, you can:

* Hover over the script’s name to see its location.
* Click the script, which will open it in a new browser tab so you can see its contents.
* Click **Edit** to open the script in the relevant script editor window.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FwD3Yn77GfNA6YBxs2uso%2Fimage.png?alt=media&#x26;token=6bdebdc0-013e-466f-bc78-5cb9fcff14a6" alt="Script editor window" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**

In the current release, you cannot modify the script’s name, format, contents, or arguments. You can disable the script as detailed in [Disable a PMPC Script](#disable-a-pmpc-script).
{% endhint %}

## Disable a PMPC Script

If you do not want to use our recommended scripts in your deployments, you can disable them (although we’d recommend you do not do this unless you have a genuine reason for doing so).

To disable a PMPC script:

1. Either [deploy ](https://docs.patchmypc.com/patch-my-pc-cloud/deployments/deploy-app)or [edit an existing deployment](https://docs.patchmypc.com/patch-my-pc-cloud/deployments/manage-deployments/edit) for the relevant app.
2. Navigate to the **Configurations** tab.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2Fjuc7dEuOvQhEhVaSX7V6%2Fimage.png?alt=media&#x26;token=c7e91596-4caa-4a15-8469-052e5ffe7b36" alt="Navigating to the “Configurations” tab" width="563"><figcaption></figcaption></figure>

3. Click the **Scripts** tool if it is not already selected.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FYn4w5u9jkVgftCxRAH7o%2Fimage.png?alt=media&#x26;token=a6ee0c7b-fdd7-42fc-a586-ad594079076d" alt="Clicking the “Scripts” tool" width="563"><figcaption></figcaption></figure>

4. Click **PMPC Scripts**

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FIFdRsJLWRz7tsva64EWb%2Fimage.png?alt=media&#x26;token=e1fbba6a-2d01-4601-8ffc-2266fefcbb72" alt="Clicking “PMPC Scripts”" width="563"><figcaption></figcaption></figure>

5. Click **Edit** beside the relevant script.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FeaoxLN59cqD8xoM8dxH9%2Fimage.png?alt=media&#x26;token=84dc4fb9-4791-48f4-ad4c-6041e69c3ab8" alt="Clicking “Edit” beside the relevant script" width="563"><figcaption></figcaption></figure>

6. If the app includes a recommended Post-Install script, go to Step 9.
7. If the app includes a recommended Pre-Install script, you have the option of checking either or both of the following checkboxes:
   1. **Don’t attempt software update if the pre script returns an exit code other than 0 or 3010**
   2. **Disable the Patch My PC Recommended Pre-Install scripts for this product**

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FNw6yJbWvJNskVzFzY8W6%2Fimage.png?alt=media&#x26;token=25d320a7-6314-45b6-ad70-df77d3ecb54e" alt="Checking the required “Pre-install checkboxes." width="563"><figcaption></figcaption></figure>

8. Go to Step 10.
9. If the app includes a recommended Post-Install script, check the **Disable the Patch My PC Recommended Post-Install scripts for this product** checkbox.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2Ff92cnhWo8iXUD8EvLgB3%2Fimage.png?alt=media&#x26;token=944dd57c-6601-403c-9917-488e109dd17d" alt="Checking the “Disable the Patch My PC Recommended Post-Install for this product” checkbox" width="563"><figcaption></figcaption></figure>

10. Click **Save**

The **Configurations** tab is displayed.

If either a Pre or Post-Install script has been disabled, a red circle is shown beside the script to indicate this and that it will not be included as part of the deployment.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FFvz4nq0vHrKJtifZF9kY%2Fimage.png?alt=media&#x26;token=4d31dd58-5e16-4e61-86f2-c1e7be8c9277" alt="Red circle is shown beside the script to indicate this and that it will not be included as part of the deployment." width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**

Checking the **Don’t attempt software update if the pre script returns an exit code other than 0 or 3010** checkbox for a Pre-Install script does not cause the red circle to be displayed.
{% endhint %}

## Enable a PMPC Script

If you have previously [disabled a PMPC Script](#disable-a-pmpc-script), you can re-enable it by [editing the deployment](https://docs.patchmypc.com/patch-my-pc-cloud/deployments/manage-deployments/edit) and following the [Disable a PMPC Script](#disable-a-pmpc-script) section, but uncheck the **Disable the Patch My PC Recommended <*****script\_type*****> for this product** checkbox.

When you click **Save** to save the deployment, a new deployment will be created that includes the script.

## How new versions are handled

If you create a deployment for an app and disable the PMPC Scripts, when your Sync Schedule runs and creates a new deployment for the new version, we check the existing deployment. If you have disabled any scripts, we will also disable them for the new deployment of the new version.
