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
Locked
qarmin
Level 1
Level 1
Posts: 8
Joined: Tue May 26, 2020 4:32 pm

How to install powershell on Wine?

Post by qarmin »

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: 236
Joined: Sun Jan 17, 2016 4:36 pm

Re: How to install powershell on Wine?

Post by qwertymnb »

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: 8
Joined: Tue May 26, 2020 4:32 pm

Re: How to install powershell on Wine?

Post by qarmin »

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: 236
Joined: Sun Jan 17, 2016 4:36 pm

Re: How to install powershell on Wine?

Post by qwertymnb »

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: 236
Joined: Sun Jan 17, 2016 4:36 pm

Re: How to install powershell on Wine?

Post by qwertymnb »

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 »

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: 236
Joined: Sun Jan 17, 2016 4:36 pm

Re: How to install powershell on Wine?

Post by qwertymnb »

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.
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: How to install powershell on Wine?

Post by Bamm »

Hello qwertymnb,

How did you get dotnet48 to install? A program I want to install requires dotnet48 and complains of its absence when I try to install it on my wine prefix that already has dotnet452. I tried winetricks dotnet48 but installation fails. I'm using Wine 5.0.2. The program is ASCOM Platform 6.5 and the installer is ASCOMPlatform65.exe. Please guide me how to get this running on wine. Thanks.

bamm
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: How to install powershell on Wine?

Post by Bamm »

No need to reply. I got dotnet48 to install already. I discovered that dotnet4.8 will successfully install if you already have 4.7. It fails if all I have is 4.0 or 4.5, or if dotnet48 is installed just by itself.
Locked