mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-04-18 14:39:09 +00:00
Remove dependency wine
, winetricks
Now `makepri` run at first-time install
This commit is contained in:
parent
a7421623b8
commit
65c7c2670d
10 changed files with 58 additions and 37 deletions
bin
docs
installer
scripts
wine/.cache/winetricks/msxml6
xml
0
wine/aarch64/makepri.exe → bin/arm64/makepri.exe
Executable file → Normal file
0
wine/aarch64/makepri.exe → bin/arm64/makepri.exe
Executable file → Normal file
0
wine/x86_64/makepri.exe → bin/x64/makepri.exe
Executable file → Normal file
0
wine/x86_64/makepri.exe → bin/x64/makepri.exe
Executable file → Normal file
|
@ -8,12 +8,10 @@
|
|||
|
||||
The following dependencies are required:
|
||||
|
||||
| DistrOS | | | | |
|
||||
|:-------------------:|-------------------------------------------------------------------------------------------------|------------|------------|--------------|
|
||||
| Debian | `lzip wine winetricks patchelf e2fsprogs aria2 python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `xz-utils` | `qemu-utils` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `xz` | `qemu-tools` |
|
||||
|
||||
The following components need to be installed using `winetricks`: `msxml6`
|
||||
| DistrOS | | | | |
|
||||
|:-------------------:|---------------------------------------------------------------------------------|------------|------------|--------------|
|
||||
| Debian | `lzip patchelf e2fsprogs aria2 python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `xz-utils` | `qemu-utils` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `xz` | `qemu-tools` |
|
||||
|
||||
The python3 library `requests` is used.
|
||||
|
||||
|
@ -27,7 +25,7 @@
|
|||
|
||||
- Debian (You can use [WSL2](https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6))
|
||||
|
||||
Need to add `contrib` sources to the source list to install winetricks.
|
||||
Ready to use right out of the box.
|
||||
|
||||
- openSUSE Tumbleweed (You can use [WSL2](https://apps.microsoft.com/store/detail/opensuse-tumbleweed/9MSSK2ZXXN11))
|
||||
|
||||
|
|
|
@ -48,6 +48,10 @@ If (((Test-Path -Path $FileList) -Eq $false).Count) {
|
|||
exit 1
|
||||
}
|
||||
|
||||
If ((Test-Path -Path "MakePri.ps1") -Eq $true) {
|
||||
Start-Process powershell.exe -Wait -Args "-ExecutionPolicy Bypass -File MakePri.ps1" -WorkingDirectory $PSScriptRoot
|
||||
}
|
||||
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
|
||||
|
||||
If ($(Get-WindowsOptionalFeature -Online -FeatureName 'VirtualMachinePlatform').State -Ne "Enabled") {
|
||||
|
|
26
installer/MakePri.ps1
Normal file
26
installer/MakePri.ps1
Normal file
|
@ -0,0 +1,26 @@
|
|||
If ((Test-Path -Path "pri") -Eq $true -And (Test-Path -Path "xml") -Eq $true) {
|
||||
$proc = Start-Process -PassThru makepri.exe -Args "resourcepack /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /if .\resources.pri /o"
|
||||
$proc.WaitForExit()
|
||||
If ($proc.ExitCode -Ne 0) {
|
||||
Write-Warning "Failed to merge resources`r`n"
|
||||
exit 1
|
||||
}
|
||||
else {
|
||||
$AppxManifestFile = ".\AppxManifest.xml"
|
||||
$ProjectXml = [xml](Get-Content $AppxManifestFile)
|
||||
$ProjectResources = $ProjectXml.Package.Resources;
|
||||
$Item = Get-Item .\xml\* -Exclude "priconfig.xml" -Include "*.xml"
|
||||
$Item | ForEach-Object {
|
||||
$Xml = [xml](Get-Content $_)
|
||||
$Resource = $Xml.Package.Resources.Resource
|
||||
$newNode = $ProjectXml.ImportNode($Resource, $true)
|
||||
$ProjectResources.AppendChild($newNode)
|
||||
}
|
||||
$ProjectXml.Save($AppxManifestFile)
|
||||
Remove-Item 'pri' -Recurse
|
||||
Remove-Item 'xml' -Recurse
|
||||
Remove-Item 'makepri.exe'
|
||||
Remove-Item $PSCommandPath -Force
|
||||
exit 0
|
||||
}
|
||||
}
|
|
@ -731,18 +731,18 @@ elif [ "$ROOT_SOL" = "kernelsu" ]; then
|
|||
cp "$WORK_DIR/kernelsu/kernel" "$WORK_DIR/wsa/$ARCH/Tools/kernel"
|
||||
echo -e "Integrate KernelSU done\n"
|
||||
fi
|
||||
[ -f "$WORK_DIR/wsa/pri" ] && {
|
||||
echo "Merge Language Resources"
|
||||
if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ] && [ "$(id -u)" != "0" ]; then
|
||||
"../wine/$HOST_ARCH/makepri.exe" resourcepack /pr "$(wslpath -w "$WORK_DIR/wsa/pri")" /cf "$(wslpath -w "../xml/priconfig.xml")" /of "$(wslpath -w "$WORK_DIR/wsa/$ARCH/resources.pri")" /if "$(wslpath -w "$WORK_DIR/wsa/$ARCH/resources.pri")" /o || res_merge_failed=1
|
||||
elif which wine64 >/dev/null; then
|
||||
wine64 "../wine/$HOST_ARCH/makepri.exe" resourcepack /pr "$WORK_DIR/wsa/pri" /cf "../xml/priconfig.xml" /of "$WORK_DIR/wsa/$ARCH/resources.pri" /if "$WORK_DIR/wsa/$ARCH/resources.pri" /o || res_merge_failed=1
|
||||
else
|
||||
res_merge_failed=1
|
||||
fi
|
||||
[ -z "$res_merge_failed" ] && sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR/wsa/xml/"* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR/wsa/$ARCH/AppxManifest.xml" &&
|
||||
echo -e "Merge Language Resources done\n"
|
||||
} && [ -n "$res_merge_failed" ] && echo -e "Merge Language Resources failed\n" && unset res_merge_failed
|
||||
# [ -f "$WORK_DIR/wsa/pri" ] && {
|
||||
# echo "Merge Language Resources"
|
||||
# if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ] && [ "$(id -u)" != "0" ]; then
|
||||
# "../wine/$HOST_ARCH/makepri.exe" resourcepack /pr "$(wslpath -w "$WORK_DIR/wsa/pri")" /cf "$(wslpath -w "../xml/priconfig.xml")" /of "$(wslpath -w "$WORK_DIR/wsa/$ARCH/resources.pri")" /if "$(wslpath -w "$WORK_DIR/wsa/$ARCH/resources.pri")" /o || res_merge_failed=1
|
||||
# elif which wine64 >/dev/null; then
|
||||
# wine64 "../wine/$HOST_ARCH/makepri.exe" resourcepack /pr "$WORK_DIR/wsa/pri" /cf "../xml/priconfig.xml" /of "$WORK_DIR/wsa/$ARCH/resources.pri" /if "$WORK_DIR/wsa/$ARCH/resources.pri" /o || res_merge_failed=1
|
||||
# else
|
||||
# res_merge_failed=1
|
||||
# fi
|
||||
# [ -z "$res_merge_failed" ] && sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR/wsa/xml/"* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR/wsa/$ARCH/AppxManifest.xml" &&
|
||||
# echo -e "Merge Language Resources done\n"
|
||||
# } && [ -n "$res_merge_failed" ] && echo -e "Merge Language Resources failed\n" && unset res_merge_failed
|
||||
|
||||
echo "Add extra packages"
|
||||
$SUDO cp -r "../$ARCH/system/"* "$SYSTEM_MNT" || abort
|
||||
|
@ -844,6 +844,9 @@ fi
|
|||
echo "Remove signature and add scripts"
|
||||
$SUDO rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR/wsa/$ARCH/AppxBlockMap.xml" "$WORK_DIR/wsa/$ARCH/AppxSignature.p7x" "$WORK_DIR/wsa/$ARCH/AppxMetadata" || abort
|
||||
cp "$vclibs_PATH" "$xaml_PATH" "$WORK_DIR/wsa/$ARCH" || abort
|
||||
cp "../bin/$ARCH/makepri.exe" "$WORK_DIR/wsa/$ARCH" || abort
|
||||
cp "../xml/priconfig.xml" "$WORK_DIR/wsa/$ARCH/xml/" || abort
|
||||
cp ../installer/MakePri.ps1 "$WORK_DIR/wsa/$ARCH" || abort
|
||||
cp ../installer/Install.ps1 "$WORK_DIR/wsa/$ARCH" || abort
|
||||
cp ../installer/Run.bat "$WORK_DIR/wsa/$ARCH" || abort
|
||||
find "$WORK_DIR/wsa/$ARCH" -maxdepth 1 -mindepth 1 -printf "%P\n" >"$WORK_DIR/wsa/$ARCH/filelist.txt" || abort
|
||||
|
|
|
@ -76,11 +76,11 @@ with zipfile.ZipFile(wsa_zip_path) as zip:
|
|||
with zipfile.ZipFile(workdir / f.filename) as l:
|
||||
for g in l.filelist:
|
||||
if g.filename == 'resources.pri':
|
||||
g.filename = f'{name}.pri'
|
||||
l.extract(g, workdir / 'pri')
|
||||
g.filename = f'resources.{name}.pri'
|
||||
l.extract(g, workdir / archdir / 'pri')
|
||||
elif g.filename == 'AppxManifest.xml':
|
||||
g.filename = f'{name}.xml'
|
||||
l.extract(g, workdir / 'xml')
|
||||
g.filename = f'resources.{name}.xml'
|
||||
l.extract(g, workdir / archdir / 'xml')
|
||||
elif re.search(u'Images/.+\.png', g.filename):
|
||||
l.extract(g, archdir)
|
||||
with zipfile.ZipFile(zip_path) as zip:
|
||||
|
|
|
@ -40,10 +40,6 @@ echo "Checking and ensuring dependencies"
|
|||
check_dependencies() {
|
||||
command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=("whiptail")
|
||||
command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip")
|
||||
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] || [ "$(id -u)" == "0" ]; then
|
||||
command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine")
|
||||
command -v winetricks >/dev/null 2>&1 || NEED_INSTALL+=("winetricks")
|
||||
fi
|
||||
command -v patchelf >/dev/null 2>&1 || NEED_INSTALL+=("patchelf")
|
||||
command -v resize2fs >/dev/null 2>&1 || NEED_INSTALL+=("e2fsprogs")
|
||||
command -v pip >/dev/null 2>&1 || NEED_INSTALL+=("python3-pip")
|
||||
|
@ -121,10 +117,3 @@ if [ -n "${NEED_INSTALL[*]}" ]; then
|
|||
fi
|
||||
fi
|
||||
python3 -m pip install -r requirements.txt -q
|
||||
|
||||
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] || [ "$(id -u)" == "0" ] && which wine64 > /dev/null; then
|
||||
winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || {
|
||||
cp -r ../wine/.cache/* ~/.cache
|
||||
winetricks msxml6 || abort
|
||||
}
|
||||
fi
|
||||
|
|
Binary file not shown.
|
@ -2,9 +2,10 @@
|
|||
<resources targetOsVersion="10.0.0" majorVersion="1">
|
||||
<index root="\" startIndexAt="\">
|
||||
<default>
|
||||
<qualifier name="Language" value="en-US"/>
|
||||
<qualifier name="Language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
|
||||
<indexer-config type="PRI"/>
|
||||
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true"
|
||||
qualifierDelimiter="." />
|
||||
<indexer-config type="PRI" />
|
||||
</index>
|
||||
</resources>
|
Loading…
Add table
Reference in a new issue