Why isn't there a simple ZIP download?

Topics: Developer Forum
Jan 2, 2014 at 5:36 PM
I understand why you made an MSI (although it didn't seem to work for me: the PSModulePath didn't seem to be changed), but I don't understand why you don't offer a simple zipped folder as an option for people who actually know what they're doing.
Jan 2, 2014 at 6:39 PM
WiX does modify the PSModulePath but it seems you need to log out and back in before it takes effect. I didn't do a zip because I got tired of answering questions about errors people were getting due to not unblocking the zip. However once you have it installed it would be easy to create a zip. Are you asking because you need a link to a zip?


Sent from my Surface 2

Jan 4, 2014 at 5:42 PM
I'm asking because
  1. Install From MSI
  2. Find Module
  3. Copy to My Module Path
  4. Uninstall Module
Was the most complicated way I ever had to install a module ;-)
Jan 22, 2014 at 10:21 PM
Edited Jan 22, 2014 at 10:47 PM
There's an API to tell explorer that a persistent environment variable has been changed. It seems like the new MSI probably isn't invoking it.

I think what's missing may be an "WriteEnvironmentStrings" entry in the InstallExecuteSequence table.

Here's a relevant article: http://blogs.technet.com/b/alexshev/archive/2008/03/28/from-msi-to-wix-part-13-installable-items-environment-variable.aspx

The other alternative would be to install the PSCX module into the existing PS directory structure. I kinda like that approach.
Jan 22, 2014 at 10:33 PM
Edited Jan 22, 2014 at 10:35 PM
Oops, replying towrong question ... Thanks for the pointer. I was also going to upgrade to WiX 3.8 and see if that helps. I'll take a look at that. Also with 4.0, there is a decent default landing spot for shared modules (besides $pshome\Modules - blech!). I'll look at that at well if I can easily determine if 4.0 is installed.
Jan 22, 2014 at 10:53 PM
Edited Jan 22, 2014 at 11:03 PM
I doubt WiX 3.8 will change anything, this is a classic problem that predates WiX entirely.

What's the 4.0 feature you are referencing? I'm primarily using PowerShell 3.0 for now. (Online service - stability is paramount.)

What's your concern with using $pshome\Modules? It seems like unique module names are a near-requirement, no matter what path-based directory they appear in. If someone else chooses to name their module PSCX, there's going to be trouble no matter what.
Jan 23, 2014 at 12:20 AM
Thanks for the heads on WiX 3.8. I look at the article as it is very bothersome that a sign out is required to recognize the env var update.
Feb 2, 2014 at 8:56 PM
The PSModulePath variable in V4, now includes this location by default:
C:\Program Files\WindowsPowerShell\Modules
It would seem if we installed into this location, there would be no need to fiddle with the PSModulePath env var - at least not for PowerShell v4 installations.
Jun 24, 2014 at 8:20 PM
I've had a similar problem with my WiX installers updating the PSModulePath environment variable.

I had to write my own C++ custom action to explicitly call:
    DWORD dwResult = 0;
    SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)TEXT("Environment"), SMTO_ABORTIFHUNG, 5000, &dwResult);
In InstallExecuteSequence, the WriteEnvironmentStrings doesn't seem to fire off the WM_SETTINGCHANGE like it should. http://msdn.microsoft.com/en-us/library/aa372883(v=vs.85).aspx

Writing my own custom action to do it was the only way to not require the user to either reboot or log out and log back in for the updated PSModulePath environment variable to be visible after the installer is finished.

Like the PSCX installer, I used the <Environment> tag under <Component> to update the PSModulePath.

Hope that helps someone out
Jun 24, 2014 at 10:11 PM
PSCX is currently on the PSGet Gallery so if you are trying out WMF 5.0 you can use Install-Module to install PSCX. Fortunately this approach ensures the module files are unblocked during installation. This is much more preferable to answering a metric crap load of support questions due to folks not unblocking the PSCX zip they downloaded from this site. :-)
Marked as answer by Jaykul on 6/24/2014 at 3:30 PM
Jun 24, 2014 at 11:46 PM
And if you're not trying out WMF 5.0, you can install it with PoshCode ;-)
Either Start-Service WebClient, or use Explorer to browse to [\PoshCode.org\DavWWWRoot\Modules](file:///PoshCode.org/DavWWWRoot/Modules/) and then run this in PowerShell:
\\PoshCode.org\DavWWWRoot\Modules\Install.ps1 PSCX