Showing posts with label Scripts. Show all posts
Showing posts with label Scripts. Show all posts

Thursday, February 25, 2016

How to run multiple scripts in App-V 5.1

Later today when I opened my blog to update a new post, I found that I already had quite some posts in drafts section. Few of them are outdated and few needed to be updated to the current date. I will be updating them and post them as soon as possible. The first post to clear from my draft bucket is how to add multiple scripts in App-V.


Earlier in App-V 5.0 it wasn't possible to run multiple scripts in deploymentconfig.xml or userconfig.xml file.

But in the latest App-V 5.1, it supports running multiple scripts both in deploymentconfig.xml or userconfig.xml file with the help of ScriptRunner.exe.


ScriptRunner.exe comes along with the App-V 5.1 client and gets installed in the client folder.






You can check how to use the ScriptRunner.exe and its parameters by opening up CMD and running ScriptRunner.exe /?






You can add multiple scripts by adding them as arguments to the ScriptRunner.exe using -appvscript parameter. The scripts run in the order as how we give them. But note we need to add the -wait parameter. If not given the scripts will run without any order.


We can add the -wait, -timeout, -rollbackonerror parameters using the -AppVScriptRunnerParameters to ScriptRunner.exe.It's not mandatory to provide all the -wait, -timeout,-rollbackonerror parameters. We can add them only when needed. But be sure to add -wait parameter if you want the scripts to run in an order to avoid issues.


ScriptRunner.exe can be used in both the DeploymentConfig.xml and the UserConfig.xml files.It can also be used in AppxManifest.xml. To know more about how to export, edit and import the AppxManifest file check here - http://app2pack.blogspot.com/2016/01/add-custom-scripts-in-appxmanifestxml.html

ScriptRunner.exe can be used in all the 8 trigger events both in the MachineScripts and UserScripts section.





To know more check the official TechNet page:
https://technet.microsoft.com/en-us/library/mt346534(v=vs.85).aspx

Thursday, January 28, 2016

Add custom scripts in AppxManifest.xml file using App-V 5.1 Sequencer

In the Package editor under advanced tab, you can see the Manifest file tab which has been introduced in App-V 5.1. This doesn't exist in earlier versions of App-V. Using this tab, you can export or import the AppxManifest.xml file.

Earlier if we want to do any custom changes we have to edit the deploymentconfig or userconfig.xml file(for adding scripts, editing FTA's etc). App-V 5.1 provides advanced way to edit those changes within the AppxManifest.xml.

To do so, click on export as highlighted below in the Manifest file tab. This will export the AppxManifest.xml file to the local machine. choose the destination and click on save.

Open the exported AppxManifest.xml using AppVManifestEditor. You can download the tool from here AVME

AVME is a simple yet powerful tool to edit the AppxManifest file.My recommendation is not to edit the AppxManifest file manually.

After opening the file using AVME,you can select the checkbox on left hand side to enable the type of script you want(Machine or User), then enter the Path (Powershell.exe) and Arguments field. After editing, save the file using the SaveAs button found at the top right side.


The output of the AppvManifest.xml will be like this.




In the Package Editor, select Import and choose the modified AppxManifest.xml file and select save in the sequencer.

This will create the virtual package with inbuilt scripts in the AppxManifest.xml file.