Problem:
Snagit 2023 Printer object does not show up after capturing Snagit Enterprise 2023 & Snagit Printer/Drivers on Windows 10.
(Note: If captured on a Windows 11 6.8.5 FPC in HC mode, Snagit 2023 will capture natively with only shortcut changes needed - This article is for Windows 10 only).
Note: This KB was created using a BAT & MST (Transform File) created with the TechSmith Deployment Tool Version 4.19.0.223. The following steps apply specifically to Snagit 2023 Enterprise (2023.1.1.27520).
1. First, create your customized (.MST & .BAT) file using the TechSmith Deployment tool.
We are using the following settings for this example, after importing the Snagit.MSI file:
(Put in your own Client ID and Passive Certificate codes from your Snagit 2023 License file)
Accept the EULA, choose the location to create the modified MST and BAT File above, then click "Create Transform".
- Log into the FlexApp Packaging console
- Click red "Create" button to create a new FlexApp, then fill in the required fields:
- MAKE SURE "High-Compatibility" mode is chosen for the capture type.
- Then click blue "Create" button on the bottom right.
- Run the Snagit installer BAT file you created in Step 1 as an Administrator from a CMD.exe line like this (Folder path may differ depending on your choice earlier).
Once it has completed installing, it will return to the C:\ prompt. Click "Finish" then "Save", then select the icon of your choice for the FlexApp, and click "Ok". (At this point you may wish to clone this package to one to work on further so that you have a "Base Capture" copy in case issues arise during this further process). - Next, "Edit" the FlexApp - Click the Edit icon/button next to the package and then "OK"
- Fix the broken shortcuts: Delete both entries and create 2 new ones pointing to the proper executables:
- Next, expand "File System" inside the package, go to "C:\ProgramData":
- Now, Right Click the "Snagit 23" Folder under "C:\ProgramData\TechSmith\", and click "Copy":
- Now "Paste" the "Snagit 23" folder onto the desktop. We will need this folder!
- Now, delete the "C:\ProgramData\TechSmith" Folder from the package. We must do this, because this Re-Parse point (Blue Icon) cannot be in the capture due to the way the Snagit Printer Setup has changed, so instead we must use PowerShell to manually put this data back properly later.
- Now that the printer folders and files are removed, it should look like this:
- DO NOT SAVE THE PACKAGE YET!
- On the FPC desktop, create a new Folder named "PORTFILE".
- Now, go into the "Snagit 23" Desktop folder that you copied out of the package, and move the file "Snagit23\PrinterPortFile" file to the "PORTFILE" folder on the desktop. You will have 2 folders on the desktop like this:
- Go to C:\Windows\Temp in File Explorer. You should see a folder like this:
- Double-click to enter the VHDX mount point/folder.
- In that folder, Cut & Paste Both "Snagit 23" and "PORTFILE" folders into the root of the package, it will look something like this in Windows File Explorer:
- Close Explorer window, and now "Save" the package.
- Save any files you wish to keep from the FPC, then shut it down and snapshot it back to a clean state or allow the 685 rollback process to complete
- To get the Printer Drivers for the final Snagit 2023 Printer, we must install the Snagit Application directly on a clean FPC, without using any capture mode, or on a regular system or virtual machine.
- After installing the application the same way as in Step 5 above, open "Printer Management" on the system. Delete any and all Printers & Drivers you are able to EXCEPT the Snagit 2023 Printer & Driver:
- Printers left after deletion:
- Drivers left after deletion:
- Click on Print Management at the top of the Left-hand Tree, then select "Migrate Printers":
- Export printer Queues and printer drivers to a file
- Choose "This Print server":
- This should be the next screen:
- On the next dialog, Choose a location and filename for your *.printerExport file:
- Make sure to copy the resulting SnagitExport.printerExport file over to a location you can reach after reverting the system back to a clean snapshot, as we are then going to "Extend" the package, and import the printer & driver.
- Revert the system to a clean snapshot, login to the FlexApp Console, and "Activate" the package in the Console by clicking the arrow on the far right of the package name. Now we need to add 2 scripts to the Package:
- Create a .CMD file named Techsmith.cmd - Paste the below into this file, as this script will run the Post-Activation PowerShell commands needed to setup the files in ProgramData and create the PrinterPort & Printer.
powershell.exe -executionpolicy bypass -noprofile -command Set-Partition -InputObject $(Get-Partition -Volume $(Get-Volume -FileSystemLabel *snagit*)) -NewDriveLetter Z
Note, the very first command line is important, and you may need to change it to match your package's Volume Label name. In this case it's "snagit-test-clone", so the part of the command -FileSystemLabel *snagit* matches "snagit-test-clone", so that is what you want. If you name it SNAGIT-2, then the correct line would be -FileSystemLabel *SNAGIT-2*. This command mounts the VHDX file using the proper volume label, and the rest of the commands do the work of copying the files and creating the printer object.
powershell.exe -executionpolicy bypass -noprofile -command New-Item -ItemType Directory -Path 'C:\ProgramData\TechSmith\Snagit 23\' -Force
powershell.exe -executionpolicy bypass -noprofile -command Copy-Item -Path 'Z:\PORTFILE\PrinterPortFile' 'C:\ProgramData\TechSmith\Snagit 23\' -Force
powershell.exe -executionpolicy bypass -noprofile -command Import-Module -Name PrintManagement; Add-PrinterPort -Name 'C:\ProgramData\TechSmith\Snagit 23\PrinterPortFile' -ComputerName $ENV:COMPUTERNAME
powershell.exe -executionpolicy bypass -noprofile -command Copy-Item -Path 'Z:\Snagit 23\*' -Destination 'C:\ProgramData\TechSmith\Snagit 23\' -Recurse -Force
powershell.exe -executionpolicy bypass -noprofile -command Add-Printer -Name 'Snagit 2023' -DriverName 'Snagit 23 Printer' -PortName 'C:\ProgramData\TechSmith\Snagit 23\PrinterPortFile' -Shared:$false
powershell.exe -executionpolicy bypass -noprofile -command Remove-PartitionAccessPath -InputObject $(Get-Partition -Volume $(Get-Volume -DriveLetter Z)) -Accesspath Z:
powershell.exe -executionpolicy bypass -noprofile -command Set-Printer -ComputerName $ENV:Computername -Name 'Snagit 2023' -PortName 'C:\ProgramData\TechSmith\Snagit 23\PrinterPortFile' - Add the Techsmith.cmd file as a "Post-Activation" Script.
- Now create a text file named CleanUp.cmd on the desktop that contains these 3 lines, to cleanup after the FlexApp closes at logoff:
powershell.exe -executionpolicy bypass -noprofile -command Remove-PrinterDriver -Name 'Snagit 23 Printer'
powershell.exe -executionpolicy bypass -noprofile -command Remove-PrinterPort -Name 'C:\ProgramData\TechSmith\Snagit 23\PrinterPortFile'
powershell.exe -executionpolicy bypass -noprofile -command Remove-Item -Path "C:\ProgramData\TechSmith" -Recurse -Force - Save the file, and add it as a "Post-Deactivation" script:
- Click "Ok", and Save the Package.
- Revert your FPC back to a clean Snapshot/image.
- Login to the FPC Console, click on the button closest to your package's name, and click on "Extend".
- Next, choose "High-Compatibility" Mode, and click on Extend.
- Next, click Start, and we'll import the printer objects and drivers from Snagit23.printerExport file.
- Double-click on the Snagit23.printerExport File.
- Choose "This Print Server", & then click Next:
- For Import Mode, choose "Keep Existing Printers", and set "List in The Directory" as "List printers that were previously listed"
- You should get Import Complete with no errors.
- Click "Finish" after the Import, then Finish & Save the newly extended package.
- Test your package in a VDI session. Ensure the Snagit 2023 printer is on the correct file port:
- Because of the way the printer driver has changed in this version, it is no longer possible to just run "SNAGITPI64.EXE" after activation anymore..
Troubleshooting notes: If your scripts are not fully executing, or having issues, you can either set a GPO to capture Powershell transcript logs to a file path, or a fileshare. On the FPC, you can do this using local group policy management, as well to log to a C:\Window\Temp\YYYYMMDD folder.
More information about Logging for PowerShell 5.1 can be found here: https://adamtheautomator.com/powershell-logging-2/
Additionally, this package can be retro-fitted to 6.8.4R2 and should work the same on Windows 10 as well:
https://www.liquidware.com/support/articles/10028601326349-FlexApp-converting-685-packages-to-684R2-when-packaging-in-684R2-fails-Out-of-the-Box
Product: ProfileUnity
Product Version: 6.8.5+
Expires on: 365 days from publish date
Updated: June 28, 2024