FlexApp KMS Office 2013 and 2016 on Windows 10/11
Problem:
How do I create a FlexApp package of Office 2013 or 2016 on Windows 10 or 11 using KMS licensing?
Resolution:
Requirements:
- ProfileUnity version 6.8.3 or newer
- Windows 10 or 11 (32-bit or 64-bit) with FlexApp Packaging Console (FPC) installed.
- The FPC machine must follow FPC best practices. (see KB)
- Office 2013 or 2016 (32-bit or 64-bit, KMS versions only!)
- KMS Server with valid working licensing
- FlexApp Office Script Bundle (1 zip file that contains 3 scripts, linked below)
Part I – Updating The Office PostCapture and PostPlay Scripts For Your Environment
***Since successful playback and capture of Office is dependent on KMS, the PostCapture and PostPlay scripts need to be updated with your KMS server information as outlined below.
- Extract the scripts located in the FlexApp Office Script Bundle locally on the FPC's Desktop or to a network location that will be accessible by the FPC machine and packaging user.
- Right click on each script and select Properties to confirm it is not blocked on the General tab. If it is, select the option to Unblock the file and click OK.
- Edit the post capture script called FA0_W10-Office2013-2016-PostCapture.cmd.
- Within the script, find and replace all instances of KMSNAME with the IP or FQDN of your KMS server.
Note: If you are using AD/domain activation you will need to change /sethst:KMSNAME to /skms-domain:DomainFQDN
- Save the changes and close out of the script.
- Now Edit the post playback script called FA2_W10-Office2013-2016-PostPlay.cmd.
- Once more, find and replace all instances of KMSNAME with the IP or FQDN of your KMS server.
Note: If you are using AD/domain activation you will need to change /skms KMSNAME to /skms-domain DomainFQDN - Before closing, ensure that the proper KMS key for both the version of Windows and Office are set. By default the script is set to cover Windows 10 Enterprise and Office 2013 and 2016 Professional Plus. (KMS keys are included at the bottom of the script for reference)
- Save the changes and close out of the script.
- You are now ready to create a DIA package of Office with FPC.
Part II – Packaging Office With FPC
-
Login to the FPC machine and connect/mount the Office installation iso to the FPC machine. (Close the AutoPlay prompt, if shown.)
- Open and log into the FlexApp Packaging Console.
- Click ‘Create’ to create a new package.
- Fill in all the required fields. For the Installer Location, browse and select the setup.exe file located at the root of the Office installation iso you mounted in step 1.
- Once all required fields are filled in, click ‘Create’ to begin the packaging process.
- FPC will launch the Office setup wizard.
- After accepting the User Agreement, choose ‘Customize’ for the installation type.
- This will present the Installation Options tab. Select the root ‘Microsoft Office’ option dropdown and choose ‘Run all from My Computer’.
- Click the ‘Install Now’ button.
- The Office setup wizard will continue and finish the installation.
-
!!CRITICAL STEP!! – BEFORE clicking the ‘Close’ button on the Office Setup Wizard, go to the location where the 3 office scripts were saved.
- Run (right-click, Run as Administrator) the script titled: FA0_W10-Office2013-2016-PostCapture.cmd
- Confirm that Office was activated successfully. There will be a line that indicates that 'Product activation successful'.
- Once confirmed, press any key to exit the command window.
- Now click ‘Close’ on the Office Setup Wizard window.
- Once the Office Setup Wizard closes, click the ‘Finish’ button in the FPC window.
- After the package creation process has finished, click the ‘Save’ button to finish saving the package.
- Since Office contains several icons for programs, FPC will likely prompt you to select an icon to use as the main one to display within FPC and ProfileUnity.
- The initial Office FlexApp package has now been created and saved successfully.
Part III – Preparing The Office DIA Package For Playback
In order for Office to playback successfully, some additional configuration is required.
- From the main FPC window, edit the package by selecting the Edit Package icon.
- In the Edit a Package screen, expand File System, navigate to C:\Windows\System32 and right-click+Delete the "spp" folder. Then click Save at the top-right.
-
From the main FPC window, press the ‘Play’ button to playback the new Office package.
- Once played back successfully, the ‘Play’ icon will change to a ‘Stop’ icon, indicating that the package is active.
- Click on the package action drop-down and select the 'abc' icon at the bottom to add scripts to the package.
- The Package Scripts window will appear, click 'Add Script'. This will reveal additional dropdown options.
- In the first drop-down, select "appdir-1".
- The second dropdown will allow you to specify when a specific script should run. The first office script requires ‘Pre Activation’. Select 'Pre Activation' and move to the next field.
- Click the browse icon to the right of this field and browse to the location where the Office scripts were saved in Part I.
- Select the script named: FA1_W10-Office2013-2016-PrePlay.cmd
- Press ‘OK’ to add this script to the package.
-
Click Add Script again.
-
Select appdir-1 in the first dropdown.
- In the second dropdown select ‘Post Activation’ this time and move to the next field.
- Click the browse icon to the right of this field and browse again to the location where the Office scripts were saved.
- Select the script named: FA2_W10-Office2013-2016-PostPlay.cmd
- Press ‘OK’ to add this script to the package.
- Click 'OK' to save and exit the Package Scripts window. The Office FlexApp package is now complete and can be selected for playback within the ProfileUnity web console or FPC.
Additional Related KBs:
If after DIA deployment you see this error...
Possible solution:
Repackage office using the above steps and add the following before closing the package.
- run the clean up tool
- https://support.microsoft.com/en-us/help/976220/description-of-the-patch-registration-cleanup-tool
- https://www.microsoft.com/en-us/download/details.aspx?id=2698
with this command.
- PatchRegCleanup-x64 {90160000-0116-0409-1000-0000000FF1CE}
You could also try and run as an extend to the package.
Product: ProfileUnity-FlexApp
Product Version: 6.8.3 and newer