8000 Use CMake for Windows installer branding and version number by kthchew · Pull Request #679 · PolyMC/PolyMC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use CMake for Windows installer branding and version number #679

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

Merged
merged 4 commits into from
Jun 12, 2022
Merged

Use CMake for Windows installer branding and version number #679

merged 4 commits into from
Jun 12, 2022

Conversation

kthchew
Copy link
Contributor
@kthchew kthchew commented May 29, 2022

Fixes #644

As a side effect, fixes an issue where the installer wrote the incorrect version to the registry.
@txtsd txtsd self-requested a review May 31, 2022 09:18
@flowln flowln added bug Something isn't working Windows Windows-related stuff labels Jun 6, 2022
@Scrumplex Scrumplex added this to the 1.3.2 milestone Jun 8, 2022
@Scrumplex
Copy link
Contributor

I just tested this using Wine, as I don't have access to a Windows VM rn.

It seems like the version is still not set.

Wine uninstaller.exe

@Scrumplex
Copy link
Contributor

Maybe we need this: https://stackoverflow.com/a/36507708

@Scrumplex
Copy link
Contributor

oh no what the fuck did i do

@DioEgizio
Copy link
Contributor

kthchew just got scrumped

@kthchew
Copy link
Contributor Author
kthchew commented Jun 12, 2022

Why does windows documentation say use X.X.X but NSIS wants X.X.X.X, and why does it have to be set in so many places ;-;

Thanks @Scrumplex

@Scrumplex
Copy link
Contributor

I have no idea. AFAIK Windows always formats it as A.B.X.Y no matter what you set yourself, so I guess that's the common denominator.

@Scrumplex
Copy link
Contributor

After testing this yet again on Wine, it seems like this didn't fix it. Still no version number in wine's uninstaller.exe.

Not sure how to proceed otherwise

@DioEgizio
Copy link
Contributor

are we sure this doesn't happen on actual windows?

@Scrumplex
Copy link
Contributor

No idea. I have no Windows VM rn

< 8000 include-fragment loading="lazy" src="/PolyMC/PolyMC/issue_comments/1153217951/edit_form?textarea_id=issuecomment-1153217951-body&comment_context=" data-nonce="2f932a4b-0eb5-82ca-c71c-b5ac2cba8d3b" data-view-component="true" class="previewable-comment-form js-comment-edit-form-deferred-include-fragment">

@kthchew
Copy link
Contributor Author
kthchew commented Jun 12, 2022

are we sure this doesn't happen on actual windows?

I vaguely remember seeing the correct number on Windows somewhere with my original PR, but I could be remembering wrong. I remember checking the registry key directly as well so I might be thinking of when I did that. I will see if I can test it later.

@kthchew
Copy link
Contributor Author
kthchew commented Jun 12, 2022

Also, I’m pretty sure the changes in 2ce4ce9 affect the version on the installer file’s properties, and doesn’t affect the actual install at all. So it probably wouldn’t change anything anyway in regards to whether WINE shows the installed version or not (but it still makes sense to make that change).

@Scrumplex
Copy link
Contributor

Let's merge this for now. Maybe we should just switch to a different installer framework. WiX looked interesting, last time I looked at it.

@Scrumplex Scrumplex merged commit 2212a6e into PolyMC:develop Jun 12, 2022
@kthchew
Copy link
Contributor Author
kthchew commented Jun 12, 2022

Found some time to test in a Windows VM.

I vaguely remember seeing the correct number on Windows somewhere with my original PR, but I could be remembering wrong

I did remember wrong. Seems like the way to test this is to check Control Panel (not Settings) – the version is missing. And the most recent commits do not resolve it either.

Also, I’m pretty sure the changes in 2ce4ce9 affect the version on the installer file’s properties, and doesn’t affect the actual install at all.

My assumption here is also wrong in theory, upon reading the docs again. What I did here:

WriteRegStr HKCU "${UNINST_KEY}" "ProductVersion" "@Launcher_RELEASE_VERSION_NAME4@"

was incorrect. When the documentation says "Derived from ProductVersion property", it actually means the property from the installer, not another registry key. Which begs the question as to why

VIProductVersion "@Launcher_RELEASE_VERSION_NAME4@"

doesn't resolve this. (Actually, it doesn't even set the info when you right click the installer and look at its details. I have no idea what this does. VIAddVersionKey does seem to work though, but the appropriate registry keys still aren't set.) Maybe the registry keys the docs mention should just be set manually instead of derived

Value Windows Installer property
DisplayVersion Derived from ProductVersion property
VersionMinor Derived from ProductVersion property
VersionMajor Derived from ProductVersion property
Version Derived from ProductVersion property

@kthchew
Copy link
Contributor Author
kthchew commented Jun 12, 2022

Maybe the registry keys the docs mention should just be set manually instead of derived

Trying this locally, I now see the version in Control Panel:
Screen Shot 2022-06-12 at 2 18 56 PM

I want to assume this would fix the original issue. I'll push the changes so you can see them. Edit: actually, I think that requires a new PR. The commit is https://github.com/kthchew/PolyMC/commit/9f039cef72d32dd2cfeee1038323e5c30af4957a. I'll wait for the CI on my fork to make an installer I can test before opening another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows Windows-related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add version number to Windows installer
6 participants
0