Squashed commit of the following:

commit 3af7ccf9c2c7ce216a4a1974fed71dc2436ad25f
Merge: 2b6a9d39 ba79b4bf
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 09:48:45 2017 -0700

    Merge remote-tracking branch 'refs/remotes/origin/rs2' into jdrs2

commit 2b6a9d39d54331662b9cca5d236dde7486834d9f
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 09:40:40 2017 -0700

    tweak lnk

commit bac2d1bbae5127c1f2db3f803de3b11b69ff299f
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 09:14:28 2017 -0700

    two mor elinks

commit cc20dca6163209b3ac1c3ed2129e48d9742b008c
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 09:06:32 2017 -0700

    update links in table

commit fb0b999debce51fa600909dbfe38aaed8622a5d4
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 08:43:01 2017 -0700

    start screen size

commit 837f33b4bdf74507b00bc4fc3fada9daa67efc7d
Merge: 9d11aca3 e0cd4034
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Tue Mar 28 08:23:48 2017 -0700

    Merge remote-tracking branch 'refs/remotes/origin/rs2' into jdrs2

commit 9d11aca3d8b9e922c57b0303825d3b0d6febb31b
Merge: 8713854e fbd1e32c
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Mon Mar 27 14:56:24 2017 -0700

    Merge remote-tracking branch 'refs/remotes/origin/rs2' into jdrs2

commit 8713854e6dce2df5d976fa2585d0a775a784d682
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Mon Mar 27 14:53:02 2017 -0700

    Andy Fu: apps feedback

commit 047779a8f2a66f647a74219c2a22c9015f909df7
Merge: 4a1bb976 ebaa19a0
Author: jdeckerMS <jdecker@microsoft.com>
Date:   Mon Mar 27 14:09:11 2017 -0700

    Merge remote-tracking branch 'refs/remotes/origin/rs2' into jdrs2
This commit is contained in:
jdeckerMS
2017-03-28 09:51:23 -07:00
parent ba79b4bf61
commit 53ab1f9691
8 changed files with 68 additions and 52 deletions

View File

@ -29,6 +29,7 @@ This walkthrough describes how to leverage the ability to include scripts in a W
2. If you need to include a directory structure of files, you will need to cab the assets for easy inclusion in the provisioning packages.
<span id="cab" />
## Cab the application assets
1. Create a .DDF file as below, replacing *file1* and *file2* with the files you want to package, and adding the name of file/directory.
@ -89,7 +90,9 @@ This walkthrough describes how to leverage the ability to include scripts in a W
## Create the script to install the application
Create a script to perform whatever work is needed to install the application(s). The following examples are provided to help get started authoring the orchestrator script that will execute the required installers. In practice, the orchestrator script may reference many more assets than those in these examples.
In Windows 10, version 1607 and earlier, create a script to perform whatever work is needed to install the application(s). The following examples are provided to help get started authoring the orchestrator script that will execute the required installers. In practice, the orchestrator script may reference many more assets than those in these examples.
In Windows 10, version 1703, you dont need to create an orchestrator script. You can have one command line per app. If necessary, you can create a script that logs the output per app, as mentioned below (rather than one orchestrator script for the entire provisioning package).
>[!NOTE]
>All actions performed by the script must happen silently, showing no UI and requiring no user interaction.
@ -138,6 +141,7 @@ PsExec.exe -accepteula -i -s cmd.exe /c powershell.exe my_powershell_script.ps1'
echo result: %ERRORLEVEL% >> %LOGFILE%
```
<span id="cab-extract" />
### Extract from a .CAB example
This example script shows expansion of a .cab from the provisioning commands script, as well as installation of the expanded setup.exe
@ -154,7 +158,9 @@ echo result: %ERRORLEVEL% >> %LOGFILE%
### Calling multiple scripts in the package
You are currently allowed one CommandLine per PPKG. The batch files shown above are orchestrator scripts that manage the installation and calls any other scripts included in the PPKG. The orchestrator script is what should be invoked from the CommandLine specified in the package.
In Windows 10, version 1703, your provisioning package can include multiple CommandLines.
In Windows 10, version 1607 and earlier, you are allowed one CommandLine per provisioning package. The batch files shown above are orchestrator scripts that manage the installation and call any other scripts included in the provisioning package. The orchestrator script is what should be invoked from the CommandLine specified in the package.
Heres a table describing this relationship, using the PowerShell example from above:
@ -166,7 +172,7 @@ Heres a table describing this relationship, using the PowerShell example from
| ProvisioningCommands/DeviceContext/CommandFiles | my_powershell_script.ps1 | Other assets referenced by the orchestrator script. In this example there is only one, but there could be many assets referenced here. One common use case is using the orchestrator to call a series of install.exe or setup.exe installers to install several applications. Each of those installers must be included as an asset here. |
### Add script to provisioning package
### Add script to provisioning package (Windows 10, version 1607)
When you have the batch file written and the referenced assets ready to include, you can add them to a provisioning package in the Window Configuration Designer.
@ -197,10 +203,15 @@ When you are done, [build the package](provisioning-create-package.md#build-pack
2. When applied at first boot, provisioning runs early in the boot sequence and before a user context has been established; care must be taken to only include installers that can run at this time. Other installers can be provisioned via a management tool.
3. If the device is put into an unrecoverable state because of a bad script, you can reset it using [recovery options in Windows 10](https://support.microsoft.com/help/12415/windows-10-recovery-options).
4. The CommandFile assets are deployed on the device to a temporary folder unique to each package.
a. For packages added during the out of box experience, this is usually in `%WINDIR%\system32\config\systemprofile\appdata\local\Temp\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands`
b. For packages added by double-clicking on an already deployed device, this will be in the temp folder for the user executing the PPKG: `%TMP%\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands`
- For Windows 10, version 1607 and earlier:
a. For packages added during the out of box experience, this is usually in `%WINDIR%\system32\config\systemprofile\appdata\local\Temp\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands`
b. For packages added by double-clicking on an already deployed device, this will be in the temp folder for the user executing the PPKG: `%TMP%\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands`
- For Windows 10, version 1703:
a. For packages added during the out of box experience, this is usually in `%WINDIR%\system32\config\systemprofile\appdata\local\Temp\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands\0`
The `0` after `Commands\` refers to the installation order and indicates the first app to be installed. The number will increment for each app in the package.
b. For packages added by double-clicking on an already deployed device, this will be in the temp folder for the user executing the provisioning package: `%TMP%\ProvisioningPkgTmp\<{PackageIdGuid}>\Commands\0`
5. The command line will be executed with the directory the CommandFiles were deployed to as the working directory. This means you do not need to specific the full path to assets in the command line or from within any script.
6. The runtime provisioning component will attempt to run the scripts from the PPKG at the earliest point possible, depending on the stage when the PPKG was added. For example, if the package was added during the Out-of-Box Experience, it will be run immediately after the package is applied, while the Out-of-Box Experience is still happening. This is before the user account configuration options are presented to the user. A spinning progress dialog will appear and “please wait” will be displayed on the screen.
6. The runtime provisioning component will attempt to run the scripts from the provisioning package at the earliest point possible, depending on the stage when the PPKG was added. For example, if the package was added during the Out-of-Box Experience, it will be run immediately after the package is applied, while the out of box experience is still happening. This is before the user account configuration options are presented to the user. A spinning progress dialog will appear and “please wait” will be displayed on the screen.
>[!NOTE]
>There is a timeout of 30 minutes for the provisioning process at this point. All scripts and installs need to complete within this time.