locked
Deleting registry entries inside the Softgrid virtual enviroment RRS feed

  • Question

  • Hi,

    We have a sequenced package of Microsoft Office 2003 (Word, Excel, Outlook and PPoint).

    On the client machines there is a local version of Outlook which writes its Profile(s) to "HKCU/Software/Microsoft/Windows NT/CurrentVersion/Windows Messaging Subsystem/Profiles". However this is interfeering with our sequenced version of Outlook. Ideally we would like them to be able to run them side by side and remove these keys from the Softgrid 'bubble'.

    We have written a script which does this and call it in the .OSD as follows:

    Code Snippet
      
        <DEPENDENCY>
            <CLIENTVERSION VERSION="3.1.2.2"/>
            <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
                <SCRIPTBODY>\\\\GCINT.GC.GOV.UK\\NETLOGON\\MSOprofilescript.cmd</SCRIPTBODY>
            </SCRIPT>
        </DEPENDENCY>
     

     

    The script is on a network share so that it can be updated easily. Here is an extract of how it is set up:

    Code Snippet
    ******************************************************************************
    ' Set Namespace and Shell objects
    '******************************************************************************

    ' Object used to get StdRegProv Namespace
    Set wmiLocator = CreateObject("WbemScripting.SWbemLocator")

    ' Object used to determine local machine name
    Set WshNetwork = CreateObject("WScript.Network")

    ' Registry Provider (StdRegProv) lives in root\default namespace.
    Set wmiNameSpace = wmiLocator.ConnectServer(WshNetwork.ComputerName, "root\default")
    Set objRegistry = wmiNameSpace.Get("StdRegProv")

    ' Define shell   
    Set WshShell = WScript.CreateObject("WScript.Shell")

    '******************************************************************************
    ' Set File System Object and logging details
    '******************************************************************************

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    strLogName = "MSOProfileScriptLog.txt"


    '******************************************************************************
    ' Deletes Profile Key with all subkeys enumerated
    '******************************************************************************

    sPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"

    'DeleteRegEntry is a function in the code
    lRC = DeleteRegEntry(HKEY_CURRENT_USER, sPath)

     

     


    The problem we are having is that when the script runs it is affecting the registry entries on the client machine, so whilst it allows the sequenced version of Outlook to work correctly the local version has lost it's Profile settings as they have been removed from the Registry.

    I would have expected that the script (from the way we are calling it) would run inside the Softgrid bubble and so only affect the virtual Softgrid registry. Why is it affecting the local registry as well?

    Any help on this matter would be greatly appreciated!

    Tuesday, May 27, 2008 4:34 PM

Answers

  • We did try that, but unfortunatly the client machine all have registry editing disabled. We have now decided to run the sequenced version of Outlook using a new profile name, this will stop other keys being pulled in since this profile will not exist in the Local Registry. Not a solution to the initial problem but a 'work-around' which is managable.

     

    Thanks for all your help.

    Monday, June 2, 2008 9:32 AM

All replies

  • Question: is the key "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" part of the sequence? If not, try adding it to the sequence and setting the Override Local Key on the Profiles level.

     

    Regards,

     

    Ment

    Wednesday, May 28, 2008 11:44 AM
    Answerer
  • Hi Ment,

     

    We did try doing that, the problem there is that becuase there are keys underneath "...\Profiles" which get pulled into the package we can't predict what they will be called and therefore cannot include and mask them.

     

    e.g. Our import PRF creates a Outlook Profile called Outlook Profile "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook Profile"

     

    When Outlook runs it pulls in a load of randomly named keys below this key which are causing the problem. Since we don't know their names in advance, we can't mask them!

     

    Chris

     

    Thursday, May 29, 2008 9:35 AM
  • Because your script deletes the Profile key, I think you would need to set the Override Local Key marker on a higher level, such as the "Windows Messaging Subsystem" key. That way the virtual registry will still be the parent of your virtual settings even though the Profile key is deleted.

    Thursday, May 29, 2008 1:40 PM
  • Hi Tanin,

     

    We have set the Overide Local Key marker on the "Windows Messaging Subsystem" key which propogates down to the "Profiles" key.

     

    Unfortunatly it appears that it doesn't prevent it from bringing in subkeys, rather it just stops the key set being overwritten.

     

    e.g. Profiles, if set to overide local key, will not get overwritten, however if Profiles has subkeys in the local system these will still be brought across.

     

    Is this the way Softgrid is supposed to work?

     

     

    Thursday, May 29, 2008 3:14 PM
  • I think I just found out what's going on here. The script just deletes a registry key, but if it connects to the registry using WMI, it will only use the physical registry. Any command given to WMI given the way it connects to the registry above will only affect the physical environment.

     

    You can use the following command to delete your registry key inside the bubble:

     

    Code Snippet
    REG DELETE "HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles" /F

     

     

    Thursday, May 29, 2008 3:30 PM
  • We did try that, but unfortunatly the client machine all have registry editing disabled. We have now decided to run the sequenced version of Outlook using a new profile name, this will stop other keys being pulled in since this profile will not exist in the Local Registry. Not a solution to the initial problem but a 'work-around' which is managable.

     

    Thanks for all your help.

    Monday, June 2, 2008 9:32 AM
  •  Tanin E wrote:

    I think I just found out what's going on here. The script just deletes a registry key, but if it connects to the registry using WMI, it will only use the physical registry. Any command given to WMI given the way it connects to the registry above will only affect the physical environment.

     

    Tanin E is correct, in that the standard system WMI provider is a native windows service and will be running "outside the bubble".

     

    ------

     

    I have not figured out why this customer is having to delete this key, as sequencing outlook normally does not.  I am guessing that it has to do with how the prf is built.  Outlook under softgrid, eh Microsoft Application Virtualization, should be prepped just as one would for a terminal server.  Either that, or the real issue is that the client machine is not clean.  You are not supposed to run a virtual app on a machine with a version of the same app locally installed.

    Friday, June 6, 2008 12:38 PM
    Moderator
  •  Madelin wrote:

    We did try that, but unfortunatly the client machine all have registry editing disabled. We have now decided to run the sequenced version of Outlook using a new profile name, this will stop other keys being pulled in since this profile will not exist in the Local Registry. Not a solution to the initial problem but a 'work-around' which is managable.

     

    May I ask why you are using WMI to delete registry key(s) as WScript.Shell object directly provides registry handling functions too?

     

    http://msdn.microsoft.com/en-us/library/293bt9hh(VS.85).aspx

     

    br,

    Kalle

    • Proposed as answer by znack Tuesday, July 28, 2009 9:02 PM
    • Unproposed as answer by Aaron.ParkerModerator Sunday, November 18, 2012 5:51 PM
    Sunday, June 8, 2008 6:52 PM
    Moderator