Sunday, October 18, 2015

How to make App-V package to read from or write to the local registry - Appv 5.0

Question : In some cases, application might require to read or write to the native registry locations. In this case how to proceed with App-V 5.0.

Answer : We can make use of PassThroughPaths key located in HKLM\Software\Microsoft\AppV\Subsystem\VirtualRegistry to read or write to local registry.

Usually when an application is launched it reads registry in the following order.

1. COW location.
2. Package location.
3. Native registry.

If we use PassThroughPaths key it can only be read/write from the native registry, bypassing the Package and COW registry locations. Pass-through locations are global to the machine (Not per package) meaning all virtual packages will make use of the path specified in PassThroughPaths to read or write to the local registry.

How to configure : It can configured by adding the path to the key PassThroughPaths in HKLM\Software\Microsoft\AppV\Subsystem\VirtualRegistry which is a REG_MULTI_SZ (Multi string).



Example we are adding HKLM\Software\Test to the PassThroughPaths so that the virtual application sees or writes only to the local registry.


In this case all published virtual applications will make use of local HKLM\Software\Test to read/write.

Wednesday, October 14, 2015

List Applications In Use - App-V 4.6 & App-V 5.0

To list applications that are in-use in App-V 4.6 & App-V 5.0 we can use the below scripts.

App-V 5.0:

1. Set execution policy to bypass or unrestricted in elevated Powershell.

2. Run the following command.

Get-AppvClientPackage -all|ft name,InUse

This command will list out applications and their status in the powershell UI.


To export these contents to a text file use the below command.

Get-AppvClientPackage -all|ft name,InUse > c:\Inuse.log

If you need to list Applications that are currently in use alone use the below script.

Create a powershell script Inuse.PS1 with the below lines.

$a=get-appvclientpackage -all
foreach ($b in $a)
{
if ($b.inuse -eq $true)
{
write-host $b.name
}
}

Run the Inuse.PS1 inside the powershell and it will list the application in-use in the powershell UI.

App-V 4.6:

1. Open an elevated CMD and type in the below command.This will create a log file with the applications and their In-Use status along with it.

sftmime query obj:package /global /log c:\VirtualApps.log

Monday, October 12, 2015

Steps to Install .CAB file in windows 7 or 8

Question: How to install .cab file? It is just a compressed archive file containing files inside it. It cannot be executed directly. We can extract the contents from the .cab file but how to install it?

Answer: We can use the build in  pkgmgr.exe (Windows Package Manager) to install the .cab file.

Steps: Open an elevated command prompt and run the following command to install the Cabinet file.
Pkgmgr /ip /m:(path to.cab file) /quiet
Example:


start /w Pkgmgr /ip /m:c:\temp\Windows6.0-KB92xxx-x86.cab /quiet
or
Pkgmgr /ip /m:c:\test.cab /quiet


Pkgmgr /? will show the complete list of commands that can be used. Screenshot below.

                                     


You can also take log file for the Installation and Uninstallation using the /l parameter at the end of the command.

Friday, October 9, 2015

How to write to 64bit registry path from a 32bit MSI using a MST using ORCA tool

In my earlier blog, I posted about how to create a transforms file to install a registry to 64 bit location in 64 bit OS using transforms in a 32 bit vendor MSI using Installshield tool.


So, in this current post I will explain how to achieve this using a simple ORCA tool.


1) Open the MSI using ORCA tool. Select Tansforms from the menu bar and click on New Transforms. This will create a new transforms where you can do the modifications.


2) Add a new row in Component table and create a new component and set the Attribute field to 256 as shown below.


Component attribute 256 - Set this bit to mark the component as a 64-bit component. (https://msdn.microsoft.com/en-us/library/aa368007(v=vs.85).aspx)


uidd43.png




3) Add a row in FeatureComponents table and map the newly created component to an existing Feature.


wiaRBZ.png


4) Go to Registry table and select the registry for which needs to be installed to 64-bit path and set the Component field to the newly created obove component.


OJfpj1.png


5) After doing the changes, select Generate Transforms from the Transforms Menu bar.


s2Jlho.png


6)) Test for the functionality by executing the msi command along with the transforms file.


msiexec.exe /I "path to msi" TRANSFORMS="path to transforms file" /qb!


NOTE: Since the MSI is meant to be 32-bit, you can ignore the ICE 80 error instead of messing up with the MSI and changing its behavior and just document the acceptance of the ICE80.