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

Add powershell app based on PowerShell Core 6.1, #1440

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

Filter by extension

Filter by extension

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

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

w_metadata powershell apps \
title="Windows Powershell" \
publisher="Microsoft" \
year="2019" \
media="download" \
file1="PowerShell-6.1.6-win-x86.zip" \
installed_file1="$W_SYSTEM32_DLLS_WIN/WindowsPowerShell/v1.0/powershell.exe"

load_powershell()
{
w_package_unsupported_win64
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed, as you said (proper 64-bit support can be a followup PR).

Copy link
Author

Choose a reason for hiding this comment

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

I wasn't planning on adding win64 support


w_warn "Installing Powershell into $W_SYSTEM32_DLLS_WIN/WindowsPowerShell/v1.0/. Note that some functionality may not work without Windows Management Framework"

w_call dotnet462

w_download https://github.com/PowerShell/PowerShell/releases/download/v6.1.6/PowerShell-6.1.6-win-x86.zip 1dc690c9a1091d0ed5b71de903ab3cd7b58ba9638acdfeb9f9fe7031abaf47e9

w_override_dlls native powershell.exe

# remove builtin placeholders
rm -f "$W_SYSTEM32_DLLS"/powershell.exe
Copy link
Contributor

Choose a reason for hiding this comment

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

Prepend with w_try



Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the extra newline.

w_try mkdir -p "$W_SYSTEM32_DLLS"/WindowsPowerShell/v1.0

w_try_7z "$W_SYSTEM32_DLLS"/WindowsPowerShell/v1.0/ "${W_CACHE}/${W_PACKAGE}/${file1}"
w_try_cd "$W_SYSTEM32_DLLS"/WindowsPowerShell/v1.0
w_try cp -f pwsh.exe powershell.exe
for file in *\\*; do
target=$(printf '%s\n' "$file" | sed 's#\\#/#g')
w_try mkdir -p "${target%/*}"
w_try mv -v "$file" "$target"
done
w_append_path "$W_SYSTEM32_DLLS"/WindowsPowerShell/v1.0
}

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

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