locked
Import .reg file to local registry before launch vapp RRS feed

  • Question

  • I recently created a v-app and it won't launch successfully unless I modify the local registry file. I try to use OSD script to import the .reg file before v-app launch  but couldn't make it to work.

    The fact is the registry setting was captured during sequencing but for some reason I still have to add it to local registry to make the vapp to launch.

    Here's the .reg file:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID]
    "ClientHWID"=hex:02,00,00,00,a3,ad,38,3a,b1,43,e3,67,66,a3,05,12,99,56,45,6c

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\Store]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\Store\LICENSE000]
    "LicenseScope"=hex:6d,69,63,72,6f,73,6f,66,74,2e,63,6f,6d,00
    "CompanyName"=hex:4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,\
      43,00,6f,00,72,00,70,00,6f,00,72,00,61,00,74,00,69,00,6f,00,6e,00,00,00
    "ProductID"=hex:41,00,30,00,32,00,00,00
    "ClientLicense"=hex:30,82,05,98,06,09,2a,86,48,86,f7,0d,01,07,02,a0,82,05,89,\
      30,82,05,85,02,01,01,31,00,30,0b,06,09,2a,86,48,86,f7,0d,01,07,01,a0,82,05,\
      6d,30,82,02,0a,30,82,01,b8,a0,03,02,01,02,02,08,01,9e,7c,38,6d,ed,69,a0,30,\
      09,06,05,2b,0e,03,02,1d,05,00,30,58,31,56,30,25,06,03,55,04,03,1e,1e,00,4a,\
      00,55,00,53,00,50,00,30,00,30,00,30,00,30,00,44,00,43,00,37,00,30,00,30,00,\
      30,00,31,30,2d,06,03,55,04,07,1e,26,00,53,00,69,00,74,00,65,00,20,00,4c,00,\

    Here's the script in the OSD:

    <SCRIPT EVENT="STREAM" TIMING="PRE" PROTECT="FALSE" WAIT="TRUE">
        <HREF>%systemroot%\syswow64\regedit.exe /s "\\yrpappserv02\content\PowerCase2012\MSLicensing.reg"</HREF>
    </SCRIPT>

    Also tried(on 32bit system)

    <SCRIPT EVENT="STREAM" TIMING="PRE" PROTECT="FALSE" WAIT="TRUE">
        <HREF>%windir%\regedit.exe /s "\\yrpappserv02\content\PowerCase2012\MSLicensing.reg"</HREF>
    </SCRIPT>

    The .reg file is on the network share which domain users have full control rights.

    Don't know why the script doesn't work. Hopefully I can get help from you guys. Thanks.

    Friday, November 2, 2012 6:46 PM

Answers

  • LOCAL_INTERACTION_ALLOWED has nothing to do with getting scripts to work.

    It won't work because you are attempting to set HKLM locations in the .reg file. To get it to work, you'll need to make the user an administrator and disable UAC - neither of which I would recommend.

    Instead try setting the values with Group Policy Preferences in a GPO applied against an OU containing the computer accounts.



    Twitter: @stealthpuppy | Blog: stealthpuppy.com

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Please remember to click "Mark as Answer" or "Vote as Helpful" on the post that answers your question (or click "Unmark as Answer" if a marked post does not actually answer your question). This can be beneficial to other community members reading the thread.



    Tuesday, November 6, 2012 8:10 AM
    Moderator
  • What do you want to achieve here? Do you actually want the registry to be local or do you want it to be in the package?

    My strategy to narrow down issues: make a copy of the shortcut to you AppV application and edit it. You'll see the AppV Client executable and after that /launch <appID>. Now between those put /exe cmd.exe so it looks like "D:\Program Files (x86)\Microsoft Application Virtualization Client\sfttray.exe" /exe cmd.exe /launch "Internet Explorer 8.0.7601.17514", Internet Explorer ofcourse being your own application. Run the shortcut. What happens now is that the virtual environment is loaded but before starting your application you are thrown into a command shell. From there you can troubleshoot your virtual environment. For example, start regedit from there and check whether or not the HKLM keys are actually there or not.
    Also make sure to delete your users cachefile for that app, or just all of it by deleting "%userprofile%\AppData\Roaming\SoftGrid Client". That makes sure your package is running from a fresh virtual environment and no old keys or anything are in the cache.

    As Rorymon said, make sure those keys are NOT in your AppV package if you really want them to be on the local system. Just edit your package in the sequencer and check the registry part. Make sure your user can actually write into HKLM. Does it work when you manually import the regfile for the user and then start the app?

    Another thing, just to narrow down is check whether or not the keys actually went into the HKLM of the client. Close all AppV apps and check the registry. Maybe your .reg ifle import actually works but AppV uses the HKLM keys that are in the package.

    By the way you should be a bit more careful posting your company license for the product in a forum just like that :)

    Tuesday, November 6, 2012 8:19 AM

All replies

  • Have you tried removing the registry from your virtual application and then setting the reg locally?. Also though for what you want I don't think it's a good move. But you could try setting LOCAL_INTERACTION_ALLOWED to True...if the reg has been set local it should look at the local reg first...

    PLEASE MARK ANY ANSWERS TO HELP OTHERS Blog: rorymon.com Twitter: @Rorymon

    Friday, November 2, 2012 9:32 PM
  • You'll probably want to set:

    SCRIPT EVENT="LAUNCH" TIMING="PRE" PROTECT="FALSE" WAIT="TRUE"

     

    If the user does not have administrative rights on the local machine, importing into HKLM won't work.



    Twitter: @stealthpuppy | Blog: stealthpuppy.com

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Please remember to click "Mark as Answer" or "Vote as Helpful" on the post that answers your question (or click "Unmark as Answer" if a marked post does not actually answer your question). This can be beneficial to other community members reading the thread.



    Friday, November 2, 2012 9:44 PM
    Moderator
  • Tried set LOCAL_INTERACTION_ALLOWED to True and SCRIPT EVENT="LAUNCH" but still doesn't work.
    Tuesday, November 6, 2012 1:09 AM
  • LOCAL_INTERACTION_ALLOWED has nothing to do with getting scripts to work.

    It won't work because you are attempting to set HKLM locations in the .reg file. To get it to work, you'll need to make the user an administrator and disable UAC - neither of which I would recommend.

    Instead try setting the values with Group Policy Preferences in a GPO applied against an OU containing the computer accounts.



    Twitter: @stealthpuppy | Blog: stealthpuppy.com

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Please remember to click "Mark as Answer" or "Vote as Helpful" on the post that answers your question (or click "Unmark as Answer" if a marked post does not actually answer your question). This can be beneficial to other community members reading the thread.



    Tuesday, November 6, 2012 8:10 AM
    Moderator
  • What do you want to achieve here? Do you actually want the registry to be local or do you want it to be in the package?

    My strategy to narrow down issues: make a copy of the shortcut to you AppV application and edit it. You'll see the AppV Client executable and after that /launch <appID>. Now between those put /exe cmd.exe so it looks like "D:\Program Files (x86)\Microsoft Application Virtualization Client\sfttray.exe" /exe cmd.exe /launch "Internet Explorer 8.0.7601.17514", Internet Explorer ofcourse being your own application. Run the shortcut. What happens now is that the virtual environment is loaded but before starting your application you are thrown into a command shell. From there you can troubleshoot your virtual environment. For example, start regedit from there and check whether or not the HKLM keys are actually there or not.
    Also make sure to delete your users cachefile for that app, or just all of it by deleting "%userprofile%\AppData\Roaming\SoftGrid Client". That makes sure your package is running from a fresh virtual environment and no old keys or anything are in the cache.

    As Rorymon said, make sure those keys are NOT in your AppV package if you really want them to be on the local system. Just edit your package in the sequencer and check the registry part. Make sure your user can actually write into HKLM. Does it work when you manually import the regfile for the user and then start the app?

    Another thing, just to narrow down is check whether or not the keys actually went into the HKLM of the client. Close all AppV apps and check the registry. Maybe your .reg ifle import actually works but AppV uses the HKLM keys that are in the package.

    By the way you should be a bit more careful posting your company license for the product in a forum just like that :)

    Tuesday, November 6, 2012 8:19 AM