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

powershell: New app #1391

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -14827,6 +14827,54 @@ load_openwatcom()

#----------------------------------------------------------------

w_metadata powershell apps \
title="Microsoft Powershell" \
publisher="Microsoft" \
year="2006" \
media="download" \
file1="ProtectionId.685.December.2016.rar" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft merge request -> Not expected to be reviewed untill finished.

Using draft so that i could get feedback for compatibility which makes the whole process easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah i think that this is a feedback? sorry will fix the metadata last since i don't know what to fill in them untill load_powershell is working

installed_file1="$W_SYSTEM32_DLLS_WIN/protection_id.exe"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft merge request -> Not expected to be reviewed untill finished.

Using draft so that i could get feedback for compatibility which makes the whole process easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah i think that this is a feedback? sorry will fix the metadata last since i don't know what to fill in them untill load_powershell is working


load_powershell()
{
# Requires at least .NET Framework 4.5.2 (https://docs.microsoft.com/en-us/powershell/scripting/wmf/setup/install-configure?view=powershell-6)
w_call dotnet462

# Download 64-bit WMF (Windows Management Framework)
w_download "http://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7AndW2K8R2-KB3191566-x64.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only occur for 64-bit prefixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like making WMF verb for 32-bit and 64-bit ?


# Download 32-bit WMF (Windows Management Framework)
w_download "http://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7-KB3191566-x86.zip"

# Unzip
## Duplicate files, using directories
[ ! -d "$W_CACHE/$W_PACKAGE/WMF_32" ] && w_try mkdir "$W_CACHE/$W_PACKAGE/WMF_32"
[ ! -d "$W_CACHE/$W_PACKAGE/WMF_64" ] && w_try mkdir "$W_CACHE/$W_PACKAGE/WMF_64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w_try mkdir -p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like using -p to avoid making unexpected directories and $W_CACHE/$W_PACKAGE is created on w_download()

Or what is the reasoning?


[ ! -e "$W_CACHE/$W_PACKAGE/WMF_32/Win7-KB3191566-x86.msu" ] && { w_try_unzip "$W_CACHE/$W_PACKAGE/WMF_32/" "$W_CACHE/$W_PACKAGE/Win7-KB3191566-x86.zip" ;} || w_debug "Archive '$W_CACHE/$W_PACKAGE/Win7-KB3191566-x86.zip' is already extracted"

[ ! -e "$W_CACHE/$W_PACKAGE/WMF_64/Win7AndW2K8R2-KB3191566-x64.msu" ] && { w_try_unzip "$W_CACHE/$W_PACKAGE/WMF_64/" "$W_CACHE/$W_PACKAGE/Win7AndW2K8R2-KB3191566-x64.zip" ;} || w_debug "Archive '$W_CACHE/$W_PACKAGE/Win7AndW2K8R2-KB3191566-x64.zip' is already extracted"

w_try "$WINE" start wusa.exe "$W_CACHE/$W_PACKAGE/WMF_32/Win7-KB3191566-x86.msu"

w_try "$WINE64" start wusa.exe "$W_CACHE/$W_PACKAGE/WMF_64/Win7AndW2K8R2-KB3191566-x64.msu"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64 only

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, will adapt.


# Doesn't work
w_download https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/PowerShell-6.2.3-win-x86.msi

# Doesn't work
w_download https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/PowerShell-6.2.3-win-x64.msi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these don't work, then why are you downloading/running them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these are the official files from upstream afaik. Seems that wusa.exe in wine is missing implementation to install powershell..

Probably workaround needed and i'm currently investigating.


# Reference for installation from M$ (https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6#prerequisites)

w_try "$WINE" msiexec /package "$W_CACHE/$W_PACKAGE/PowerShell-6.2.3-win-x86.msi"

w_try "$WINE" msiexec /package "$W_CACHE/$W_PACKAGE/PowerShell-6.2.3-win-x64.msi"

}

#----------------------------------------------------------------

w_metadata protectionid apps \
title="Protection ID" \
publisher="CDKiLLER & TippeX" \
Expand Down