none
Applying a ComputerName to the Virtual Registry (APPV5.x) RRS feed

  • Question

  • Hello All,

    This seems such a simple thing to do but it's just not!

    From what I read the registry is in a REGISTRY.DAT file that is not applied until the first application in the sequence is started via the shortcut. Short of launching a script to write the %COMPUTERNAME% into a select part of the registry I am out of ideas.

    Things I have tried (and don't work).

    Adding %COMPUTERNAME% to the Registry key via the sequence. 
    Result: %COMPUTERNAME% literally as the value.

    Using scripts at Addpackage and Publishpackage events via a PS Script. (AppVManifest file).
    Result: Key is not populated.

    My Sequence has MANY shortcuts, so I don't want to go with the script at launch, populate, then launch the app method.

    Please tell me there's another way yo do this.

    Thanks.. Bryn

    Thursday, August 15, 2019 11:48 AM

All replies

  • Have you tried using Timothy Mangan's scriptrunner? It can give you the real environment variables.

    ScriptLauncher is an executable that you place on the client machine and reference as the scripting program in your config.xml files. You make Scriptlauncher.exe the primary script program to run, and then place the complete command line of the script you want to run (including any environment variables) as arguments to the program.

    ScriptLauncher will parse and dereference the EnvironmentVariables for you and run the command, even if the App-V Scripting subsystem will not.

    ScriptLauncher will create an added environment variable for use in the script called "EffectiveUserName". Use this variable in place of UserName when you run scripts that run in the User Security Context. I love using this to reference C:\Users\%EffectiveUserName%\AppData\Roaming.

    You could also merge the registry Key as you would do with a file in base os. Then your script should be able to write correct. Or exclude it from the package completly using registry passtrough path. But beware that all packages would exclude that. 

    https://stealthpuppy.com/just-how-do-exclusions-in-app-v-packages-work/ 


    Thursday, August 15, 2019 7:32 PM