wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 24 forks source link

ps:SnapIn installation writes to wrong registry key when using PowerShell 3.0. #4524

Open wixbot opened 10 years ago

wixbot commented 10 years ago

We have a PowerShell snapin that requires version 3.0 of PowerShell to function. So we used the following file element in a WiX (3.8) file:

    <File Id="MySnapin.dll" 
          Name="MySnapin.dll" 
          Assembly=".net" 
          KeyPath="yes" 
          Vital="no" 
          Checksum="yes" 
          DiskId="1" 
          Source="$(var.FilesPath)\Bin\MySnapin.dll" 
          AssemblyApplication="MySnapin.dll">
       <ps:SnapIn Id="MySnapin" 
                  Description="This is a PowerShell snap-in" 
                  Vendor="My Company Inc." 
                  RequiredPowerShellVersion="3.0">
            <ps:FormatsFile FileId="MySnapin.format.ps1xml" />
       </ps:SnapIn>
    </File>

However, when installing this the snapin cannot be found in powershell (Get-PSSnapIn -Registered). When examining the registry it turns out that the snapin has been registered in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\3\PowerShellSnapIns\MySnapin. But when running installutil.exe on the DLL, the registration ends up in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\MySnapin, and powershell finds it properly. It seems this a bug in WiX Toolset?

Originally opened by decaf

wixbot commented 10 years ago

Release changed from v3.8 to v3.x