winetricks icon indicating copy to clipboard operation
winetricks copied to clipboard

Added new verbs: powershell_core and powershell

Open ProjectSynchro opened this issue 2 years ago • 3 comments

Saw an older PR that died a few years ago so I figured I'd try.

The Powershell Core verb is based on the Latest LTS release that supports both 32 and 64 bit Windows.

I didn't include dotnet48 as it isn't explicitly required by PowerShell Core and is quite heavy to install, it doesn't provide everything you would be using it for anyways. If it's wanted it can trivially be added.

The powershell verb is based on wrapper code is hosted at: https://github.com/ProjectSynchro/powershell-wrapper-for-wine, this is a fork of https://github.com/PietJankbal/powershell-wrapper-for-wine, I contacted the maintainer but they didn't get back to me so I went ahead and forked, if things change the links to the powershell wrapper binaries and profile.ps1 can be changed.

Let me know if there is anything I should do formatting-wise, I kind of copied what was around and attempted to keep things in alphabetical order. I would stick powershell_core after powershell, but with powershell requiring powershell_core it is what it is.

ProjectSynchro avatar Apr 14 '24 20:04 ProjectSynchro

I tried to derive as much as possible from the metadata (including version from file1), let me know if you'd like any more changes.

ProjectSynchro avatar Apr 28 '24 19:04 ProjectSynchro

looking forward to having a verb for this, the star citizen game launcher is unable to perform two critical functions without powershell

mactan-sc avatar May 11 '24 23:05 mactan-sc

@austin987 Is there anything else that you'd like done to get this merged?

AFAIK I have actioned everything you had suggested.

Cheers.

ProjectSynchro avatar Jun 20 '24 20:06 ProjectSynchro

I cleaned up the commit history.

Let me know if there are any additional changes needed, from what I can see I think it should be good to go, unless there's another linter I haven't found to run :smile:

ProjectSynchro avatar Jul 11 '24 06:07 ProjectSynchro

Decided to just go with the "silence shellcheck" route, hopefully that's okay. :smile:

Ran the same script your CI does to verify scripts and that seems to have passed.

ProjectSynchro avatar Aug 02 '24 05:08 ProjectSynchro

Decided to just go with the "silence shellcheck" route, hopefully that's okay. 😄

Yep, that's fine.

Ran the same script your CI does to verify scripts and that seems to have passed.

Are you sure :)? It fails for GitHub Actions with 0.8.0 (and with 0.10.0 for me locally):

In src/winetricks line 12489:
        w_try cp "${file3}" "${W_PROGRAMW6432_UNIX}/PowerShell/7/${file3}"
                  ^------^ SC2154 (warning): file3 is referenced but not assigned (did you mean 'file'?).

What version of shellcheck did this work with?

AFAIK Shellcheck directives have to be on the line above the offending line (or at the top of the file, or before the function name), see https://www.shellcheck.net/wiki/Directive. That said, to be fair, I'm not sure why it worked for the other cases.

The safest way to handle it is to put the directive directly above the affected lines (that way if any future variables are added to these functions, they're not affected).

austin987 avatar Aug 08 '24 11:08 austin987

Are you sure :)? It fails for GitHub Actions with 0.8.0 (and with 0.10.0 for me locally):

In src/winetricks line 12489:
        w_try cp "${file3}" "${W_PROGRAMW6432_UNIX}/PowerShell/7/${file3}"
                  ^------^ SC2154 (warning): file3 is referenced but not assigned (did you mean 'file'?).

What version of shellcheck did this work with?

This worked with 0.10.0, but after testing this again it looks like the shell-checks script fails silently if bashate is not installed. I'm not sure if this is intentional or not but I'm guessing not :)

Installing it has the script running correctly, and I was able to repro the issue you found.

BTW, sent a fix in here: https://github.com/Winetricks/winetricks/pull/2254

AFAIK Shellcheck directives have to be on the line above the offending line (or at the top of the file, or before the function name), see https://www.shellcheck.net/wiki/Directive. That said, to be fair, I'm not sure why it worked for the other cases.

The safest way to handle it is to put the directive directly above the affected lines (that way if any future variables are added to these functions, they're not affected).

Agreed, I suspect since the scripts are interpreted, it disables the checks in whatever context the directive is located. I stuck them above each of the effected lines

ProjectSynchro avatar Aug 09 '24 02:08 ProjectSynchro

Thanks (for the PR, and your patience :) )!

austin987 avatar Aug 12 '24 23:08 austin987

No problem :)

ProjectSynchro avatar Aug 13 '24 12:08 ProjectSynchro