Replaceing PscxHome env var with registry key

Topics: Developer Forum
Coordinator
Feb 13, 2008 at 5:02 AM
FYI, I am on a mission to eliminate the PscxHome environment variable. It has caused too many issues for folks first installing PSCX. I am replacing it with a registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Pscx 
RegVal: InstallDir

Set that regval to your bin\Release dir and you'll be good to go. You should remove the PscxHome environment variable from your development system.
Developer
Feb 13, 2008 at 3:26 PM
Hi Keith, how about using HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Pscx:ApplicationBase directly? As an additional benefit, our installer wouldn't have to do anything special.
Developer
Feb 13, 2008 at 3:29 PM
...and switching between dev/release versions would only require running of installutil
Coordinator
Feb 13, 2008 at 8:10 PM
Great idea. I didn't even realize that existed. However does the '1' change for V2 to a '2'? If so I guess we could look for 2 first and then for 1 (or vice versa). BTW do you know if the VS 2008 Setup project fixed the issue with registering (installutil) of the snapin on X64?
Developer
Feb 13, 2008 at 11:01 PM
No, at the moment, nothing in V2 should be changing. Only the file version. Assembly version, filesystem paths, registry paths, script extensions, all are 1.0. Not that I think it's great, because it's so hard to write scripts to be run on the old version when you are running 2.0, but it sure makes porting the snapins a lot easier.

I don't believe anything in the Visual Studio setup generator has changed in Orcas. Supporting dual x86/x64 setups would be quite a major feature. But I can check.
Coordinator
Feb 13, 2008 at 11:33 PM
For dual x86 vs x64 installations, is the PostInstall.cmd the only thing we do differently for support x64? I'm just wondering if we couldn't modify the installer with a custom action "installutil" the snapin on x64. BTW is there a possibility that folks would want to use PSCX with a 32bit PowerShell on x64 (or is that even possible)?
Coordinator
Feb 13, 2008 at 11:41 PM

jachymko wrote:
Hi Keith, how about using HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Pscx:ApplicationBase directly? As an additional benefit, our installer wouldn't have to do anything special.


Done!
Developer
Feb 14, 2008 at 12:02 AM

rkeithhill wrote:
BTW is there a possibility that folks would want to use PSCX with a 32bit PowerShell on x64 (or is that even possible)?


Definitely. PowerShell x64 includes the 32-bit version; imagine there would be only a 32-bit build of some library -- there would be no way of loading it into a 64-bit process. Pretty much like Internet Explorer comes in both versions on x64 Windows, since there might be some 32-bit-only add-ons.

But yeah, we should write a custom action calling Framework64\InstallUtil, I guess it would be much more reliable than the existing batch file.
Coordinator
Feb 20, 2008 at 4:56 AM

jachymko wrote:
But yeah, we should write a custom action calling Framework64\InstallUtil, I guess it would be much more reliable than the existing batch file.


Done. Tested. And checked in.