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

Updated 7zip to 24.09 and added 7zip arch bits conditional installation #2310

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

ThisNekoGuy
Copy link
Contributor

Updated 7zip to 24.09 and added arch bits conditional installation for win32 and win64

Better implementation of my attempt of #2302 that doesn't require a new verb.

Updated 7zip to 24.09 and added arch bits conditional installation for win32 and win64
@ThisNekoGuy
Copy link
Contributor Author

Huh?? Shellcheck didn't say anything about an issue on my system-- Oh, I see...
Weird that variables in the URL are a problem... I'll fix that.

@ThisNekoGuy
Copy link
Contributor Author

That should do it. I also tested it to make sure it works, and it does.

src/winetricks Outdated
media="download" \
file1="7z2408.exe" \
installed_exe1="${W_PROGRAMS_X86_WIN}/7-Zip/7zFM.exe"
if [ "${W_ARCH}" = "win32" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

w_metadata should be the same for both architectures.

Copy link
Contributor Author

@ThisNekoGuy ThisNekoGuy Dec 17, 2024

Choose a reason for hiding this comment

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

The problem with that is leaving it the same would create the issue of placing the 64-bit version in the 32-bit programs folder...
That's why I separated the metadata conditionally per architecture with otherwise minimal changes besides also targeting the correct executable per architecture.

Functionally, this would never get in the way of normal usage because winetricks only ever gets run against one prefix per invocation...
I know it's not as clean as just having one w_metadata, but I don't know well enough how installed_exe2 would or should be treated as an alternative when attempting installation. :/

I'll look into this again later after getting some sleep

Copy link
Contributor

Choose a reason for hiding this comment

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

@ThisNekoGuy I was thinking something like this:

diff --git a/src/winetricks b/src/winetricks
index 0a5884a3..edfe9942 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -15731,14 +15731,19 @@ w_metadata 7zip apps \
     publisher="Igor Pavlov" \
     year="2024" \
     media="download" \
-    file1="7z2408.exe" \
-    installed_exe1="${W_PROGRAMS_X86_WIN}/7-Zip/7zFM.exe"
+    installed_exe1="${W_PROGRAMS_WIN}/7-Zip/7zFM.exe"
 
 load_7zip()
 {
-    w_download https://www.7-zip.org/a/7z2409.exe e35e4374100b52e697e002859aefdd5533bcbf4118e5d2210fae6de318947c41
+    if [ "${W_ARCH}" = "win32" ]; then
+        w_download https://www.7-zip.org/a/7z2409.exe e35e4374100b52e697e002859aefdd5533bcbf4118e5d2210fae6de318947c41
+        _W_installer_exe=7z2409.exe
+    elif [ "${W_ARCH}" = "win64" ]; then
+        w_download https://www.7-zip.org/a/7z2409-x64.exe bdd1a33de78618d16ee4ce148b849932c05d0015491c34887846d431d29f308e
+        _W_installer_exe=7z2409-x64.exe
+    fi
     w_try_cd "${W_CACHE}/${W_PACKAGE}"
-    w_try "${WINE}" "${file1}" ${W_OPT_UNATTENDED:+/S}
+    w_try "${WINE}" ${_W_installer_exe} ${W_OPT_UNATTENDED:+/S}
 }
 
 #----------------------------------------------------------------

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, that does seem like a good idea; I hadn't considered just redefining the metadata later...
Am I right in thinking this means ${W_PROGRAMS_WIN} is redefined based on the arch of the prefix?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, see winetricks_set_wineprefix()

Copy link
Contributor Author

@ThisNekoGuy ThisNekoGuy Dec 17, 2024

Choose a reason for hiding this comment

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

Looks a bit vaguely defined to me when both of them are set to this:
W_PROGRAMS_WIN="$(w_expand_env ProgramFiles)"
with no clear distinction for which bits folder that gets set as per arch even if I follow where w_expand_env() is defined, but I'll take your word for it

Unless I'm just being silly and not realizing that ProgramFiles just defaults to the correct arch.

@austin987 austin987 merged commit 418f280 into Winetricks:master Dec 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants