Problem:
FlexApp packaging Visual Studio Code with extensions
Possible resolution:
For Non-Persistent VDI
- Start a capture of Visual Studio Code then finish and save it to use as a base.
- Playback the capture and Install the extensions of choice from the extension manager in Visual Studio Code.
The extensions files will be located at %userprofile%\.vscode\extensions.
- Open File Explorer and create a folder called extensions at any location as that location will be used temporarily. Afterwards copy the folders from %userprofile%\.vscode\extensions to that location.
- Once the extensions are finished copying stop the playback of the app
- Click on extend package of the Visual Studio Code and click on start to start extending (Installer Location will be left blank)
- Go to C:\ProgramData in file explorer and create a folder named vscode
- Copy the temp extensions folder (made from step 3) to C:\ProgramData\vscode
- Save the package and click Finish
- Afterwards playback the Visual Studio Code package
- Go to Add Script for the Visual Studio Code package within the FlexApp packaging console and add the cmd/bat file included as a Post Activation script. (Example: Contents of the script is shown below)
Script content:
@echo off
if not exist "%userprofile%\.vscode\extensions\" Goto NOTEXIST
:NOTEXIST
Xcopy C:\ProgramData\vscode\extensions\ %userprofile%\.vscode\extensions\ /E /H /C /I /Y
Else :END
exit - Stop the playback, Flexapp packaging console, then playback once more. The extensions will appear upon opening Visual Studio Code.
When using ProfileDisk:
Step 1 should be all that's needed. Extensions will be preserved in the Profiledisk if visual studio code is needed for future use.
Adding portability Rule for non-persistent
Extensions on non-persistent machines can be preserved as well by using a Portability Rule.
In Portability Management with ProfileUnity, create a new Portability Ruleset and have the operation set to Merge, Folder set to User Profile and Path as .vscode then click add and save.
You can add this to your configuration under portability settings within the current config.
Product: ProfileUnity Flexapp
Product Version: 6.8.4 R2+
Expires on: 365 days from publishing
Updated: June 28. 2024