Conversation
Resolves cli#703 along with several other issues: * Build an x64 MSI for an x64 executable. This means the binary is installed to C:\Program Files, by default, rather than C:\Program Files (x86) without the ability to redirect it to 64-bit locations. * Environment change to PATH is not system-wide, which for a per-machine install it should be so all users who can access the executable have it in their PATH. * Environment change to PATH is not cleaned up when uninstalled. * RTF conversion of LICENSE was difficult to read. A simple conversion script is checked in to facilitate regenerating RTF from root LICENSE.
|
@mislav is there an easy way to test the release workflow without releasing a new version? It should work, but I'd like to resolve any issues earlier rather than later. This may be more code, but keep in mind it provides the flexibility needed to not only fix the problem in #703, but quite a few others I described in the initial commit message. I've testing the upgrade path from 1.14 through built 2.1.0 and 2.2.0, where the latter remembers the user-specified directory. Many of these changes are not possible with Unfortunately, there is no safe, reliable way of cleaning up the |
Also simplifies directories for an always-release binary.
mislav
left a comment
There was a problem hiding this comment.
This is great! I've just tried this locally and it works well.
I'll try to come up with some setup where we can trigger the release manually for testing instead of carving git tags.
|
@mislav something else to consider is to build the executable for x86 and ship only an x86 MSI. It installs on any Windows architecture (except Server Core if WOW64 was uninstalled, which is incredibly rare). Given it's an EXE, doesn't need GBs of memory, and had network-bound performance anyway, there's no reason it has to be chip-specific. Can still remember the directory it's installed to, though it would still be redirected away from 64-bit-only directories. Not advocating for it necessarily, but it solves the problem of users picking the "right" package. |
That's a really interesting proposition that we haven't considered at all. Although, at this point I find it slightly risky to downgrade our x64 official binary to x86 just to support 32-bit systems which comprise (in my estimation) less than 5% of our Windows users. So I think it would be safest to provide a separate x86 build that could eventually be retired after we deem it not worthwhile to support 32-bit systems anymore. |
|
Understood. Did you want me to update the workflow to build an x86 version of the EXE and MSI then, or just keep it handy in case it's requested. Anyone installing the existing EXE via MSI (the MSI would've installed, but the EXE wouldn't run), scoop, etc. on an x86 box wouldn't have been able to run it anyway, but I did at least update the WiX authoring to be ready in case you do. Also, any reply yet regarding the license dialog or the cross-scoping? Removing the license dialog (and then everything related to the license I did) doesn't take much, but cross-scoping normally doesn't work well in practice with the same MSI. From experience, it causes more problems than it solves. There's always scoop or a direct download for users who don't want to or can't elevate - no different than |
No, I think we ourselves will be able to add that on top of what you've already set up; thank you!
|
* Removed license dialog * Removed RTF copy of license
|
@mislav this PR is ready now. |
|
@mislav was there anything else you were waiting on here? |
|
@mislav, I saw 2.1.0 was recently released. It would be nice to get this in for users sooner than later. |
|
I'm leaving for sabbatical soon and it would be great to get this in for the next release. |
Any chance this change can be merged? Dealing with installation as admin then fiddling with PATH would be great to avoid. :) |
|
AFK for a meeting for a bit, but here is where we are: I'm assuming there is some variable expansion / quoting issue splitting an argument to msbuild |
I get that bash is being used on a Windows box, but the $PWD directory here seems very odd. Does that seem correct to you? At any rate, what about just adding |
|
Trying to repro locally with bash from Git for Windows, it seems we can switch |
|
For posterity, @vilmibm and I discussed offline whether to support any potential customized install directory for the older MSIs and decided against it. Despite the amd64 binary shipping all this time, the MSI was built for x86 and, thus, the gh.exe executable was always installed to If, for some reason, we ever did want to support upgrades from the older MSIs that didn't retain the install directory, this is all that's needed: diff --git a/build/windows/gh.wxs b/build/windows/gh.wxs
index 1e91734f..c244f704 100644
--- a/build/windows/gh.wxs
+++ b/build/windows/gh.wxs
@@ -45,6 +45,12 @@
<!-- Restore the INSTALLDIR if previously persisted to the registry -->
<Property Id="INSTALLDIR">
<RegistrySearch Id="InstallDir" Root="HKLM" Key="SOFTWARE\GitHub\CLI" Name="InstallDir" Type="directory"/>
+ <!-- Try to use install location of previous installer package -->
+ <ComponentSearch Id="OldInstallDirSearch" Guid="{6E6DCB19-3CF6-46D1-AC56-C6FB39485C9D}" Type="file">
+ <DirectorySearch Id="OldInstallDir" AssignToProperty="yes">
+ <FileSearch Id="OldInstallFile" Name="gh.exe" />
+ </DirectorySearch>
+ </ComponentSearch>
</Property>
<Feature Id="DefaultFeature" ConfigurableDirectory="INSTALLDIR">It will use a component search to fine the file and set the Note also that a registry value is used to store the INSTALLDIR going forward. This is the general property persistence pattern with Windows Installer and generally more useful than using a |
Resolves #703 along with several other issues: