Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Due to this created as x86, the powershell it is running is 32 bit version. Which is missing some command. #17

Open
publicst opened this issue Apr 4, 2018 · 9 comments

Comments

@publicst
Copy link

publicst commented Apr 4, 2018

Hi, I realized that I was not able to run Add-MpPreference using this extension.
And came accross following thread.

https://stackoverflow.com/a/46166988/1076116

I downloaded the extension source and noticed that it is indeed built for 32 bit.
Would you intent to make it 64 bit?

@flcdrg
Copy link
Owner

flcdrg commented Apr 4, 2018

That's a good idea. Feel free to create a PR for this.

This info is probably relevant to ensuring the NuGet package works for 32/64bit - https://stackoverflow.com/questions/35179461/adding-x86-and-x64-libraries-to-nuget-package

@publicst
Copy link
Author

publicst commented Apr 9, 2018

I built everything with x64, now before jumping to NuGet, I attempted to run the resulting dll from my project. However, I received this.

Severity Code Description Project File Line Source Suppression State Error The extension '..\PowerShellWixExtension\Libs\PowerShellWixExtension.dll' could not be loaded because of the following reason: Could not load file or assembly 'file:///D:\WS\InstallBeta-Int\WiXETAPUISandBox\PowerShellWixExtension\Libs\PowerShellWixExtension.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. WiXSandBox-ETAPUI candle.exe 0 Build

Reading following, I made sure every single project were x64, yet the same issue persists.
https://stackoverflow.com/q/1648213/1076116

@flcdrg
Copy link
Owner

flcdrg commented Apr 10, 2018

Sounds like WiX is running .NET as x86. Might need to research what is required to make WiX/MSI run x64 custom actions?

@publicst
Copy link
Author

Looking at Rob's comment from https://stackoverflow.com/questions/15495998/custom-action-as-64-bit-process it seems like it is just a matter of selecting the right platform. But compiler tells me else-wise.

@publicst
Copy link
Author

Looking at PowerShellActions' References, Microsoft.CSharp dll seems to be 32 bit. Would this affect this matter?

@publicst
Copy link
Author

This is so bizarre but re-retrieving the nuget 2.0.1 version and trying it out again ran the Add-MpPreference successfully. What was the hours I spent on this issue... sigh. I do not think this is an issue any more.

@publicst
Copy link
Author

Found common denominator with this issue. Windows 10 with version 14393 seems to cause this issue.

@publicst
Copy link
Author

Get-Command for the windows 10.0.16299 Powershell(x86) showed me very interesting thing where now they added the Add-MpPreference on that version. I thought some how the 16299 was running 64 bit but no, it continues to run the 32 bit version of the powershell.

@ddurham2
Copy link

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants