Thank you Tim for an old post about script execution that shows adding and publish scripts would execute outside the bubble. That broke my whole method down.
The application will work if i migrate the keys from HKLM to HKCU so I was in the process of doing that since i could script the change. At the same time, i got the bright idea of enabling PVAD control and moving the install to the root.
20 minutes later I had a working package without a script.
SO...... Moral of the story. Try PVAD earlier in the process with an install to the root. This one looks like another candidate for the PVAD crapplication list.
Ugh... I have a very stupid application, Aspect RTA 18.2, that throws an error upon launch notifying the user that it's not being run from the installed location. In App-V 4, this wasn't an issue because Q:\.... was still Q:\.... on the target machine.
With Appv 5, C:\Program Files (x86)\Aspect\RTA now because some long path under ProgramData\App-V.
There is a registry value in HKLM called ProgramDir which I can change and it stops the error message, however, there are some problems.
1) I can't set this in the package and then compile because it changes the version GUID each time.
2) The application does not like junctions so I can't use the Integration point, or any other manually created symlink.
I created a powershell script and inserted it into the package. The script gets the package and version guid, and updates the registry within the bubble.
3 days later of pulling out my hair, i have come to realize that when the script executes, either on publish, or on adding, the registry locations aren't available. So it fails to add the key. I confirmed this by doing a reg query and piping to a file. If i run cmd.exe in the bubble afterwards and the script, works great.
At what point do the packaged registry hives become loaded with regards to the execution of a script? Or are there better ways to inject a path into the registry for the package and version guid?