How to install powershell on Wine?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
qarmin
Level 1
Level 1
Posts: 5
Joined: Tue May 26, 2020 4:32 pm

How to install powershell on Wine?

Post by qarmin » Wed May 27, 2020 10:36 am

Hi,

Recently I tried to install Powershell but it needs at least WMF 4.0, but I can't find any method to install it because it provides msu files which I don't know how to use.

https://www.microsoft.com/en-us/downloa ... x?id=54616

qwertymnb
Level 4
Level 4
Posts: 148
Joined: Sun Jan 17, 2016 4:36 pm
Location: Eindhoven de gekste!

Re: How to install powershell on Wine?

Post by qwertymnb » Mon Jun 08, 2020 5:21 am

What installer of Powershell are you trying to use? Do you have link to the download so we could try?

Further AFAIK, wine does not handle some msu files properly yet (like this one apparently which is likely msdelta compressed); I made a homebrew winetricks-script some time ago to extract the archived files from such msu-files, but that probably won`t help much for the powershell installer as it probably also needs registrykeys (apart from the nuisance having to manually copying over the files to the correct locations); somehow in future wine should install those msu files properly

qarmin
Level 1
Level 1
Posts: 5
Joined: Tue May 26, 2020 4:32 pm

Re: How to install powershell on Wine?

Post by qarmin » Mon Jun 08, 2020 1:46 pm

https://github.com/PowerShell/PowerShel ... in-x64.msi

I wanted use it for installing choco because it would be a lot of easier tool to check a lot of software than manual installation of each package.

qwertymnb
Level 4
Level 4
Posts: 148
Joined: Sun Jan 17, 2016 4:36 pm
Location: Eindhoven de gekste!

Re: How to install powershell on Wine?

Post by qwertymnb » Mon Jun 08, 2020 5:15 pm

You can trick/fool the installer; it checks for the version of pwrshplugin.dll (a dll that wine doesn`t provide)

Trick/fool the installer with some dll:

cp -rf ~/.wine/drive_c/windows/system32/msxml3.dll ~/.wine/drive_c/windows/system32/pwrshplugin.dll
cp -rf ~/.wine/drive_c/windows/syswow64/msxml3.dll ~/.wine/drive_c/windows/syswow64/pwrshplugin.dll

Now the installer starts and completes. Then do "wine start pwsh.exe"

Regards

qwertymnb
Level 4
Level 4
Posts: 148
Joined: Sun Jan 17, 2016 4:36 pm
Location: Eindhoven de gekste!

Re: How to install powershell on Wine?

Post by qwertymnb » Wed Sep 16, 2020 5:18 pm

qarmin wrote:
Mon Jun 08, 2020 1:46 pm
https://github.com/PowerShell/PowerShel ... in-x64.msi

I wanted use it for installing choco because it would be a lot of easier tool to check a lot of software than manual installation of each package.
Hi, late reply; I fixed up a wrapper to give wine`s powershell at least a bit of functionality (using the Powershell Core mentioned): https://github.com/PietJankbal/powershe ... r-for-wine

I made this really for Waves Central, but now also tried choco;
I can get choco installed following https://chocolatey.org/docs/installation (after first doing ""winetricks dotnet46), and when i try to install something with choco like e.g. audacity it goes well upto a point where it says "finishing additional installation steps" and then it errors out. Maybe that`s a wine-bug or maybe it needs more needs additional some dotnet* installed (?). Any idea what dotnet version this choco needs?

Predatorian3
Level 1
Level 1
Posts: 8
Joined: Wed Jan 02, 2013 4:50 pm

Re: How to install powershell on Wine?

Post by Predatorian3 » Thu Oct 15, 2020 3:23 pm

Take a look at this:
That has the .NET Framework version and some other things you'd need on there. This page should also have more information on the requirements for the install
I would just put .NET Framework 4.7.1 on there as it'll cover all the other .NET installs you'd need.

Code: Select all

env WINEPREFIX=/home/filbot/.local/wine/POWASHELL winetricks --force --unattended corefonts dotnet471

qwertymnb
Level 4
Level 4
Posts: 148
Joined: Sun Jan 17, 2016 4:36 pm
Location: Eindhoven de gekste!

Re: How to install powershell on Wine?

Post by qwertymnb » Sat Oct 17, 2020 4:02 pm

Hi, I made an automatic installer of chocolatey here: https://github.com/PietJankbal/Chocolatey-for-wine
(especially note it only works on very recent wine-versions >5.18 or so)

Downsides: Takes long (>5 min) to install, mainly due to fact it installs needed dotnet40 and dotnet48, which takes long time; Only works (probably) on fresh newly created prefixes, or at least prefixes without any dotnet versions installed via winetricks.

Upside: "choco list" gives 5524 packages to install/test so that can keep you busy for while ;)
And once you got the prefix with choco installed, automatic installation of a basic setup with browser, texteditor etc. is as simple as typing "wine choco install firefox notepadplusplus -y" etc.

Side note: Do _not_ expect miracles: if an installer has a bugreport against it like IE11 it will also fail with chocolatey... I tested simple things like firefox, gzdoom, gvim, audacity and they install quickly and fine.

Post Reply