Found out how to make detectionrules:
Using the free application tweakappv from Advanced installer we have finally found a working api for modifying files inside our created app-v packages without using manual editing in the annoying Sequencer.
This way we have automated creation of detection rules into App-V packages.
Short story:
Get the manifest.xml out of the app-v package (treat reading from appv file like a zip file).
When you have the manifestfile make a script/program that read from the xml file.
Find "Identity Name",'Version="', 'appv:PackageId="' and 'appv:VersionId="'.
Using stringsplit get the values and store as variables.
Then write four cmd files and insert detectionrules like: 'reg add "hklm\software\wow6432node\companyname\Appv\' & $PackageName & '" /v AddPackage /t reg_sz /d ' & $Version & "/" & $PackageID & "/" & $VersionID & " /f") into our cmd files.
We just call them AddPackage.cmd, PublishPackage.cmd, UnpublishPackage.cmd and RemovePackage.cmd.
Settings is like this:
Package Scripts:
On adding package:
In machine context: YES
- Script:%windir%\system32\cmd.exe
- Parameters: /c AddPackage.cmd
- Wait for App-V Client to Complete: YES
- Do not use encoded executable paths: YES
- Script timeout: 999 secounds
On package publish:
In machine context: YES
- Script:%windir%\system32\cmd.exe
- Parameters: /c PublishPackage.cmd
- Wait for App-V Client to Complete: YES
- Do not use encoded executable paths: YES
- Script timeout: 999 secounds
On Package unpublish:
In machine context: YES
- Script:%windir%\system32\cmd.exe
- Parameters: /c UnpublishPackage.cmd
- Wait for App-V Client to Complete: YES
- Do not use encoded executable paths: YES
- Script timeout: 999 secounds
On removing package:
In machine context: YES
- Script:%windir%\system32\cmd.exe
- Parameters: /c RemovePackage.cmd
- Wait for App-V Client to Complete: YES
- Do not use encoded executable paths: YES
- Script timeout: 999 secounds
And woila.
Your “new” version of the package will have the needed detection rules. The rest of the code needed is not available for sharing atm., but it should be easy enough if you can script/program.