-
Notifications
You must be signed in to change notification settings - Fork 615
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
installer: Fix version of installer and installed file #235
Conversation
installer/install.iss
Outdated
@@ -74,7 +74,7 @@ PrivilegesRequired=none | |||
UninstallDisplayIcon={app}\{#MINGW_BITNESS}\share\git\git-for-windows.ico | |||
#ifndef COMPILE_FROM_IDE | |||
#if Pos('-',APP_VERSION)>0 | |||
VersionInfoVersion={#Copy(APP_VERSION,1,Pos('-',APP_VERSION)-1)} | |||
VersionInfoVersion=GetFileVersion('{#MINGW_BITNESS}\bin\git.exe') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this is executed? I could imagine that the APP_VERSION
constant is defined somehow without a dash...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But APP_VERSION
is defined through installer/release.sh
, right? Anyway, this was just to make you remember what you said (which I think is not the correct approach). According to your words that day, you are actually changing the version of the installer, according to what (binary) is provided with git-sdk, instead of giving it the version what user wants (through installer/release.sh
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the wish was for the file version in the properties of the installer executable to match the file version in the properties of the included git.exe
, and I kind of agree...
And yes, APP_VERSION
is defined in config.iss
that is written by installer/release.sh
. But is it not also used for the installer's window title? IOW APP_VERSION
is used, but we may not want to use it for the file version of the .exe
.
If you change this so that VersionInfoVersion
is defined independently from APP_VERSION
, but using GetFileVersion()
instead, does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is it not also used for the installer's window title?
Yes, ofc, it is used for window's title and other stuff (regedit). But won't it be a bad UX if user sees different versions, I mean, on title bar and installer/installed bin? What was the intended use of APP_VERSION
again? Can't we change the version of file while packing?
If you change this so that
VersionInfoVersion
is defined independently fromAPP_VERSION
, but usingGetFileVersion()
instead, does it work?
I can make GetFileVersion()
work, but again, it will face the formentioned problem. Also how can we generate git-sdk
using git-sdk
? (basically mingw64\bin\git.exe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file version is limited to four numbers separated by dots, IIUC, the version displayed in the window title is free form. So it can be a lot more expressive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dscho my main concern here is UX, I mean if we are showing some different version on the title bar and installing some other version then this is bad(I know that we'll not be shipping such installer but yeah :P).
I'm making it to change the VersionInfoVersion
to match the binary included and I guess we shall not be needing the conditional here because then we will get the same problematic installer when using sdk build (installer|git-and-installer)
or installer/release.sh <version-string>
?
build-extra/installer/install.iss
Lines 76 to 80 in bbe200d
#if Pos('-',APP_VERSION)>0 | |
VersionInfoVersion={#Copy(APP_VERSION,1,Pos('-',APP_VERSION)-1)} | |
#else | |
VersionInfoVersion={#APP_VERSION} | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
@dscho can you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we simplify this further? Have you tested and verified that it works?
installer/install.iss
Outdated
#define FILE_VERSION GetFileVersion(SourcePath+"\..\..\..\..\" \ | ||
+MINGW_BITNESS+"\bin\git.exe") | ||
#define PROD_VERSION GetStringFileInfo(SourcePath+"\..\..\..\..\" \ | ||
+MINGW_BITNESS+"\bin\git.exe", "ProductVersion") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use ExpandConstant('{#SourceDir}')
(or something similar to make use of SourceDir
) for both arms, making them identical, i.e. you can move the definition of FILE_VERSION
and PROD_VERSION
out of the conditional?
I'll see if we can simplify it further ... Yes, I've verified and it works according to my understandings. |
To be clear: I think there is no need to put those |
@dscho I tried changing the code, but it gave error |
As discussed on IRC, we'll try to use |
fecd672
to
ed65f19
Compare
Yes, I've tested it, and it works! |
Yes, I agree this is prettier. |
As reported by @JJClements, the File version and Product version of the installer and installer binary were not the same. They are set by the `installer/release.sh` and by using `sdk build (installer | git-and-installer)` commands, which created this discrepancy. Create two macros, `FILE_VERSION` and `PROD_VERSION` to store File and Product version of the included binary and copy it to the installer file. Closes: git-for-windows/git#1797 Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
Excellent, thank you so much! |
The file/product version stored in the installer's `.exe` file [now matches the version of the included `git.exe` file's](#235). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As reported by @JJClements, the File version and Product version of the installer and installed binary were not the same. They are set by the
installer/release.sh
and by usingsdk build (installer | git-and-installer)
commands, which created this discrepancy.Closes: git-for-windows/git#1797