# Distribute P2P installer

## Overview

You can create a Windows app (Win32) in Intune to install the Adaptiva Client by publishing the `adaptiva-client-p2p-<version>-windows.msi` installer. Clients will download the 1MB P2P MSI and then use peer-based distribution to source the full installation files.

## Prerequisites

You will need to download and install the [Microsoft Win32 Content Prep Tool](https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool) to complete these steps.

## Access the Adaptiva Client

The Adaptiva Client is available from the Installation folder of the installation media. You can download the latest release from the [Product Releases](https://support.adaptiva.com/hc/en-us/sections/201965326-Product-Releases) section of the Adaptiva Support Portal.

**For users of OneSite Patch SaaS**, you can access the P2P installer or cross-platform installation scripts from the Cloud Admin Portal.

## Deploy the P2P Installer

You need to install the Adaptiva client using the SYSTEM account, so you need to use a Windows (Win32) App rather than a Line-of-Business app. To install the app in the Device content, you must create an `.intunewin` file and configure a Win32 App in Intune to install the app correctly.

When you distribute the Win32 App, devices will download and run the 1MB `adaptiva-client-p2p-<version>-windows.msi` from Intune. The device will then look for a peer on the local subnet to access the full client installer. If not found, the installer will download full installer either from a server share or an internet accessible location.

For any Intune clients on the internet, you need to host the full client install (`adaptiva-client-<version>-windows.exe`) in a cloud storage container or CDN accessible to clients over the internet. Clients that are on-premises will download the client from a peer.

### Share the Full Installer

* **Create a local network share**

  Create a network share for on-premises users to access the Adaptiva Client Installer.

  1. Create a content source folder as follows:

     `<Drive>:\<Path>\Adaptiva\FullClient`
  2. Copy the **adaptiva-client--windows.exe** from the Adaptiva installer files in \Adaptiva\AdaptivaClient\Bin.
  3. Share this folder on the server as **AdaptivaClient** with the following permissions:

     Share permissions: **Everyone: Read**

     NTFS permissions: **Domain Computers: Read & Execute, List folder contents, Read**
* **Create an internet-accessible share**

  Create an internet accessible share using any cloud storage or CDN provider. Copy the full `adaptiva-client-<version>-windows.exe` installer to this cloud storage container and ensure that you provide an appropriate access policy or token to allow clients to access it.

### Create Intunewin File for P2P Installer

Download and install the [Microsoft Win32 Content Prep Tool](https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool).

1. Create a content source folder as follows:

   `<Drive>:\\<Path>\Adaptiva\P2PClient`
2. Copy the `adaptiva-client-p2p-<version>-windows.msi` from the installation source into the P2PClient folder.
3. Open Notepad and create an install.cmd command for your appropriate installer:

   Choose the appropriate command for your environment.

   * For the OneSite Patch SaaS installer:

     `%windir%\system32\msiexec.exe /I adaptiva-client-p2p-<version>-windows.msi /qn WAITFORCOMPLETION=1`
   * On-premises with a share:

     `%windir%\system32\msiexec.exe /I adaptiva-client-p2p--windows.msi /qn WAITFORCOMPLETION=1 CLOUDRELAY=1 SERVERNAME=%1 SERVERGUID=%2 SOURCEUNCPATH=%3 %4 %5`
   * On-premises with a URL:

     `%windir%\system32\msiexec.exe /I adaptiva-client-p2p--windows.msi /qn WAITFORCOMPLETION=1 CLOUDRELAY=1 SERVERNAME=%1 SERVERGUID=%2 SOURCEURLS=%3 %4 %5`
   * Both with share and URL:

     `%windir%\system32\msiexec.exe /I adaptiva-client-p2p--windows.msi /qn WAITFORCOMPLETION=1 CLOUDRELAY=1 SERVERNAME=%1 SERVERGUID=%2 SOURCEUNCPATH=%3 SOURCEURLS=%4 %5 %6`
4. Save this file as **Install.cmd** in the P2PClient folder.
5. Open a command prompt at the intunewin tool folder and run the following command:

   `IntuneWinAppUtil.exe -c "<Drive>:\<Path>\Adaptiva\P2PClient" -s Install.cmd -o "<Drive>:\<Path>\Adaptiva\P2PClient"`

### Create Intune App for P2P Installer

Perform the following in Microsoft Intune.

{% hint style="info" %}
For more information on distributing line of business apps using Microsoft Intune, see <https://learn.microsoft.com/en-us/intune/intune-service/apps/apps-win32-app-management>.
{% endhint %}

1. Log into the Microsoft Intune admin center (<https://intune.microsoft.com>) using the account with the appropriate role assignment.
2. In the left-hand navigation pane, click **Apps**, then click **All Apps**.

   ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-eb3f2e2a75038d7a67d6c334d9227574956019fa%2Fimage79.png?alt=media)
3. Click **+ Create**.
4. In the right pane, select the **App type** drop-down.
5. Under **Other**, select **Windows app (Win32)**.

   ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-ee53be60b7ee9bd0950f4c3ae4600b9e061f37a4%2Fimage80.png?alt=media)
6. Click **Select**.
7. The **Add App** pane appears.

   ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-c7ee15d7997efedb528557c4dda240b576cf0a89%2Fintune-add-app.png?alt=media)
8. Click **Select app package file**.
9. In the right pane, click on the folder icon.

   ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-1dfa4398bdab7ea4de6f1e1387114816aad39e4c%2Fimage82.png?alt=media)
10. Browse to the path with your .intunewin file: `<Drive>:\<Path>\Adaptiva\P2PClient` and select the install.intunewin file. Click **Open**.
11. The right pane will be updated with the package file details. Click **OK**.
12. Under the **App Information** step, update the properties with these and any other values as appropriate. These are user facing values.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-2fab9529bb21724ac5370cdb3c87ab407b09217a%2Fimage84.png?alt=media)

    * **Name** and **Description**: Update the name and description to user friendly values.
    * **Publisher**: Adaptiva
13. Update the other fields as necessary and click **Next**.
14. On the **Program** tab, enter the following:

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-349dbe30014d82b6af52f499ed4c72a537c19c55%2Fintune-add-program.png?alt=media)

    * **Install command**:

      Choose the appropriate command for your environment.

      * For the OneSite Patch SaaS installer:

        `install.cmd`
      * On-premises with a share:

        `install.cmd [SERVERNAME] [SERVERGUID] [SOURCEUNCPATH] [optional parameters]`
      * On Prem with the URL

        `install.cmd [SERVERNAME] [SERVERGUID] [SOURCEURLS] [optional parameters]`
      * Both with share and URL:

        `install.cmd [SERVERNAME] [SERVERGUID] [SOURCEUNCPATH] [SOURCEURLS] [optional parameters]`

      Parameters need to be in the same order as defined in Install.cmd. Be sure to replace with the specific server information.
    * **Uninstall command**:

      `%windir%\system32\msiexec.exe /i adaptiva-client-p2p-<version>-windows.msi UNINSTALL=1`
    * **Install behavior**: System
    * **Device restart behavior**: No specific action
15. Click **Next**.
16. On the **Requirements** tab, click **Yes. Specify the systems the app can be installed on.**
17. Click to select the **Install on x86 system** and **Install on x64 system** checkboxes.
18. Select the **Minimum operating system**.
19. Complete any additional requirements as needed.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-533522aad444de41c37f334e93d74a9ee1a1aa9a%2Fintune-add-requirements.png?alt=media)
20. Click **Next**
21. On the **Detection Rules** tab, click the **Rules format** drop-down and select **Manually configure detection rules**.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-6eb19e12b43396021aa9fdc92a26e3fcf778206f%2Fimage89.png?alt=media)
22. Click **+ Add**

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-95ff904873e8030577b72c66ca355267e7868d58%2Fimage90.png?alt=media)
23. In the right-hand pane, click the **Rule type** dropdown and select **MSI**.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-e114ed273df70070e88a1c9f554067a3b4f4af7b%2Fimage91.png?alt=media)
24. Create the following rule:

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-850c076636907e52a45d1a0948d90d1503f21741%2Fimage97.png?alt=media)

    * **Key path**: HKEY\_LOCAL\_MACHINE\Software\Adaptiva\Client
    * **Value name:** slm.version
    * **Detection method**: Value exists
    * **Associated with a 32-bit app on 64-bit clients**: No
25. Click **OK**.
26. Click **Next**.
27. On the **Dependencies** tab, click **Next**.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-09ede509a487c86edfca9bd7a8a95627825f9b3a%2Fimage93.png?alt=media)
28. On the **Supersedence** and **Scope tags** tabs, click **Next**.
29. On the **Assignments** tab, configure assignments for the following groups. Assignments do not need to be entered right now; they can be entered later.

    ![](https://1238239958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcNZqjCKqgdpA83eD4o%2Fuploads%2Fgit-blob-57b89549d33b6b9c786fb43e2699d12ce7e450c2%2Fimage94.png?alt=media)

    Add a group to **Required** to force the installation.

    Add a group to **Available** for enrolled devices to make the installation optional via the Company Portal app. When adding a group to Available, the group must contain Users, not Devices.

    Add a group to **Uninstall** for managed devices to have this app removed.
30. Click **Next**.
31. Review the App information and click **Create**.
