Thursday, February 11, 2016

App-V 5.1 bug or expected behaviour?

Recently I came across a post in TechNet as the scripts added in deploymentconfig.xml file is not getting triggered when using the App-V generated MSI file for publishing in App-V 5.1.


I planned to do a simple test to check this case before giving out confirmation from my end. Below I have compared this scenario between App-V 5.0 SP3 and App-V 5.1 generated MSI's.


App-V 5.0 SP3:

Step 1- Created a virtualized package.
Step 2- Added a script in deploymentconfig.xml file which would do a simple file copy.




Step 3- Ran the App-V 5.0 SP3 generated MSI and found that it is using the deployment config file and triggered the script and copied the file as expected.
Step 4- Reverted the machine to clean state.
Step 5- Edited the deployment config file and removed / in </MachineScripts>



Step 6- Ran the MSI and see the below error.


Step 7- Checked in App-V event log and see the exact reason for failure that tag is not closed properly.


This proves that App-V 5.0 packages use deployment config file.

App-V 5.1:

Step 1- Created a sample virtualized package using App-V 5.1.
Step 2- Performed the same steps like above. Added a script in deploymentconfig.xml file which would do a simple file copy.




Step 3- Ran the MSI and found that it is not using the deployment config file and did not trigger the script. The file wasn't copied like expected.
Step 4- Reverted the machine to clean state.
Step 5- Edited the deployment config file and removed / in </MachineScripts>



Step 6- Ran the MSI and see that it is getting installed successfully. This shouldn't be the case.

This proves that App-V 5.1 has some sort of bug when installed through its generated MSI that it is not using the deploymentconfig.xml like previous App-V 5.0 version or is this the expected one that App-V 5.1 generated MSI will no longer use the deploymentconfig.xml file? Expecting Microsoft App-V Team to give their answer.

UPDATE:


Editing the App-V 5.0 SP3 PackageMsiTemplate.msi in c:\Program Files\Microsoft Application Virtualization\Sequencer\en-us shows that SetPublishPackage32 Customaction has condition set to below.

APPV_OR_MSI_FILE=[APPV_OR_MSI_FILE];APPV_DEPLOYMENTCONFIG=[APPV_DEPLOYMENTCONFIG];APPV_LOCAL=[APPV_LOCAL];MSI_TEMPLATE_REGKEY=Software\Microsoft\AppV\MsiTemplate\[ProductCode]

                  

Editing the App-V 5.0 SP3 sequencer generated MSI with ORCA shows that SetPublishPackage32 Customaction reflects the same as in PackageMsiTemplate.msi


APPV_OR_MSI_FILE=[APPV_OR_MSI_FILE];APPV_DEPLOYMENTCONFIG=[APPV_DEPLOYMENTCONFIG];APPV_LOCAL=[APPV_LOCAL];MSI_TEMPLATE_REGKEY=Software\Microsoft\AppV\MsiTemplate\[ProductCode]

                  

In App-V 5.1:


Editing the App-V 5.1 PackageMsiTemplate.msi in c:\Program Files\Microsoft Application Virtualization\Sequencer\en-us shows that SetPublishPackage32 Customaction has condition set to below.

APPV_OR_MSI_FILE=[APPV_OR_MSI_FILE];MSI_TEMPLATE_REGKEY=Software\Microsoft\AppV\MsiTemplate\[ProductCode]




It is missing APPV_DEPLOYMENTCONFIG=[APPV_DEPLOYMENTCONFIG] property and so App-V 5.1 generated MSI doesn't use the deployment config file while installing in standalone mode.


Many a thanks to App-V Techie Roy Essers for confirming this point.

12 comments:

  1. Confirmed, so I looked at the MSI with Orca at the SetPublishPackage32 Customaction:
    SP3: APPV_OR_MSI_FILE=[APPV_OR_MSI_FILE];APPV_DEPLOYMENTCONFIG=[APPV_DEPLOYMENTCONFIG];APPV_LOCAL=[APPV_LOCAL];MSI_TEMPLATE_REGKEY=Software\Microsoft\AppV\MsiTemplate\[ProductCode]

    5.1: APPV_OR_MSI_FILE=[APPV_OR_MSI_FILE];MSI_TEMPLATE_REGKEY=Software\Microsoft\AppV\MsiTemplate\[ProductCode]

    Clearly missing the APPV_DEPLOYMENTCONFIG property.

    ReplyDelete
    Replies
    1. Thanks for pointing this Roy. Will update my blog.
      If you have any blog, kindly let me know. will add you in my blogroll.

      Delete
  2. This is news to me, I never knew that applying the XML via the MSI was ever supported, I had been using a custom MST to do it! Perhaps this was added in SP3?

    http://packageology.com/2014/03/applying-dynamic-config-app-v-5-msi-packages/

    ReplyDelete
    Replies
    1. @Dan,

      This feature was supported only in App-V 5.0 SP3. I guess App-V team have reverted it back by removing this support in App-V 5.1.
      I checked with App-V 5.0 SP2 PackageMsiTemplate.msi file and see that it is also missing APPV_DEPLOYMENTCONFIG property. I have also posted in App-V uservoice. Hope to get a prompt reply.
      http://appv.uservoice.com/forums/280448-microsoft-application-virtualization/suggestions/12300822-app-v-5-1-generated-msi-not-using-deployment-confi

      Delete
  3. Thanks for the confirmation, as far as I know this was not a documented feature hence there being no mention of its removal. My MST should work for 5.1 but I have not tested it!

    ReplyDelete
    Replies
    1. Hi Dan,I will test your transform file with App-V 5.1 and update you in a short time.

      Delete
  4. Before posting here, I forgot to mention your mst still works great with 5.1 Dan :)

    ReplyDelete
  5. + Confirming

    It works fine with App-V 5.1 Dan :)

    ReplyDelete
  6. The 5.0 SP3 method is much better than my hacky powershell custom action that effectively has to publish the app twice. I have a new MST that can apply this method to 5.1 (or anything under 5.0 SP3) MSIs, and will also fix the fact the SP3 packages have to be ran with admin rights. Blog to come!

    ReplyDelete
    Replies
    1. Good to know Dan :) I was also working on implementing the 5.0 SP3 concept earlier last week. Couldn't have much time to look into it now. Will be looking forward to your blog soon :D

      P.S - off topic
      I have sent you a facebook friend request :)

      Delete
    2. Removing the launch condition Privileged will bypass the requirement to run as admin. I had blogged about it earlier but it is in draft version. Have you done any other changes other than removing the launch condition?

      Delete
  7. Much more than that, details to come!

    ReplyDelete