You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugSomething isn't workingpackagingpriority-2Affects more than a few users but doesn't prevent core functionswindowsRelated to Windows hosts or runners
Thank you for reporting, and nice catch! I must admit I haven't tried changing the installation path when we initially tested the installer.
Our Windows release process is powered by go-msi, which in turn invokes WiX Toolset to create the MSI installer. So I suspect the bug with the changed path not being respected is in one of these projects.
The bug with amd64 binary defaulting to C:\Program Files (x86) is most likely a separate issue and might come down to a configuration problem.
We will look into this when we have a chance! If there is in the meantime a Windows person experienced with WiX who would like to take a look at this, please be our guest 🙇
Thanks, I just noticed that my original report listed wrong paths all over, fixed this now. I've looked into both go-msi and WiX prior to opening this issue but wasn't able to find any similar problems on their sides. Maybe someone else knows more :-)
Just wanted to report that both issues of the OP are still present in today's first out of beta release 1.0.0 .
I'm sure the devs have this issue in mind,
it's just that those, like me, that install the first non beta version of GitHub CLI via gh_1.0.0_windows_amd64.msi ,
get the wrong impression that the installed gh.exe is a x86 binary.
Thanks for reporting, all. This is still an ongoing issue, as evident by this ticket still being open. We appreciate your patience while we address this.
Not sure if this helps or not, but I installed gh_1.12.1_windows_amd64.msi on my personal and work computer in two alternative separate locations and the MSI worked as intended.
Because the OP still stands.
Using win10 x64 21H1, I just (uninstalled v1.12.0 x64 and) tried to install gh_1.12.1_windows_amd64.msi :
The default install location was still wrong, C:\Program Files (x86)\GitHub CLI (error 1)
And, even if I set it to C:\Program Files\GitHub CLI, it installed it: C:\Program Files (x86)\GitHub CLI (error 2).
My apologies, I didn't test for that. Yeah that happens for me too. Default location is x86 on a win10 x64, and I can't successfully change it to Program Files. I'd like to look into this.
These directives switch between Program Files (x86) and Program Files. However, the resulting MSI will always be created with Program Files (x86), even on a 64-bit system, due to the fact that it fails to call candle (a utility that's part of the WiX toolset) with the -arch x64 flag, and as a result always producing the installer that's hardcoded for 32-bit systems.
It's a pretty deep problem and I think fixing that and related other MSI issues will require us to stop using go-msi and perhaps write XML by hand and interface with WiX Toolset directly.
I'm not sure how attached you all are to the WiX toolset but I built a inno setup installer tonight and I think it may solve a few of the MSI issues posted.
New features over the existing installer (correct me if I'm wrong):
allows user to decide if gh should be installed local to the current user or to the system (based on admin privileges)
executable is installed in the specified location
back buttons work
features neat github icon :)
Things that need to be added to the new installer:
agree to terms check box / script
signed releases
if this is something that might interest the team, let me know and I'll continue to work on it.
Given we're dealing with GitHub users, that is, developers, this should be a very minor issue ;)
@igorakkerman fair, however no one likes extra steps considering wix might not be all that bad.
I think I'll go ahead and finish out the inno setup prototype, which would include a licensing page, an automation shell script, and the feature that would uninstall a <1.14.x version if it is found on the system. Then I'll tag mislav to maybe get a better opinion on the subject
I was a developer on WiX for many years and dealt with internal Windows Installer support for many more. The problem is that the MSI is built for x86 and ProgramFilesFolder will always be the x86 path even if you specify another directory because it gets redirected back. You need separate installers for x86 and x64, unfortunately.
I can fix this so that the MSI is always x64, but I'm wondering if x86 support is even needed. I see it's in the general Windows support issue, so I'm assuming so. Fortunately, the winget package manifest schema can support both x86 and x64 so anyone using that will get the right one automatically.
MSI (c) (3C:C4) [23:05:00:167]: PROPERTY CHANGE: Modifying INSTALLDIR property. Its current value is 'C:\Program Files (x86)\GitHub CLI\'. Its new value: 'C:\Program Files\GitHub CLI\'.
MSI (c) (3C:C4) [23:05:00:236]: WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\GitHub CLI\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
MSI (c) (3C:C4) [23:05:00:236]: In SetTargetPath, re-mapping 'C:\Program Files\GitHub CLI\' to 'C:\Program Files (x86)\GitHub CLI\' because this is a 32-bit package being installed on Win64.
To add, an x64 MSI can install to both 32- and 64-bit locations, but will fall to install at all on an x86 OS.
@heaths It's great to hear you have WiX experience! I would love it if we could get to a point where we're generating separate MSI installers for x86 and x64. Then, the x64 installer could default to C:\Program Files instead of C:\Program Files (x86).
The tricky part is, right now every x64 Windows user has GitHub CLI installed to C:\Program Files (x86)\GitHub CLI because our installer is busted and they couldn't have changed the directory even if they tried. When we publish a fixed MSI installer for those platform, what should we do with the old directory? Should we have some explicit instructions in WiX XML files to clean up that directory if one is detected? Or is the process of upgrading the GitHub CLI version through MSI always going to clean up the previous version automatically?
Second, what is the best way to enable the user to choose their install location for GitHub CLI and have it be remembered between upgrades? Is that done by writing a registry entry? We don't do that right now, but I think it would be necessary if we fix choosing the install location. No sense in being forced to choose the same install location over and over on every manual upgrade.
Cleaning up the old install is easy. You just schedule RemoveExistingProducts before InstallInitialize. There's some other nuance I'd be happy to author including remembering the install location. Not sure if the current solution building the MSI will support that, but if needs be I can author a project and ask the support necessary. The build environment can be downloaded from NuGet, though I believe windows-latest includes a recent WiX install anyway.
For now, it's just an x64 binary, correct? Or are you building an x86 as well? The x64 MSI could install both. An x86 MSI can also be used to support ARM64 but if a native ARM64 binary is desirable, that will need to be a separate MSI still. I've been working with both the PowerShell team and my old team, the Visual Studio Installer team, on similar solutions.
For now, it's just an x64 binary, correct? Or are you building an x86 as well? The x64 MSI could install both.
What do you mean? Are you suggesting that we publish a single x64 MSI that contains gh.exe binaries for both architectures and is installable on 32-bit Windows?
Not sure if the current solution building the MSI will support that, but if needs be I can author a project and ask the support necessary.
No, as I said, we'd have to drop go-msi from our release automation (it's a project that wraps creating WiX XML files and calling the WiX Toolset on it), so I was thinking of rolling an XML file by hand in a separate branch and inviting you to take a look at/collaborate on it.
though I believe windows-latest includes a recent WiX install anyway.
Yeah, we'd just call candle and light in a GitHub Actions job on Windows.
No, an x64 MSI cannot install on x86. It can install binaries for both architectures, though. A separate MSI is needed for x86.
The key is fragments and not authoring component GUIDs. In most cases, the auto-GUIDing feature work correctly and avoid costly and confusing behaviors.
I recommend using a .wixproj and running MSBuils on that. Running candle and light - especially when multiple source files world be easier to manage - is doable but unnecessary. Projects make it easier, as well as adding in extensions out building chainers. For example, of you built a bundle, the x64 and/or x86 MSIs could be installed automatically based on the target system. Projects allow you to specify dependencies, infer build order, and even reference project variables in other projects.
For context, here's a recent one waiting on a final review (review is vacationing but back soon): PowerShell/openssh-portable#521. It can produce both an x86- and x64-only MSI, though there's no current plans for x86 (but may be later, hence the support now). For an EXE, having both x86 and x64 doesn't really make sense and does make the authoring easier where you only have to condition whether to use ProgramFilesFolder or ProgramFiles64Folder to use in the default path, and the UpgradeCode. The rest of the authoring can pretty much be the same. The <Environment> to augment the PATH should be put into the same component as the sole gh.exe since it's a versioned file and will auto-GUID correctly.
The x86 and x64 MSIs should probably be mutually exclusive and there's a way to do that. That way, you don't have both in the PATH. I suppose there's probably nothing terribly wrong with that, though.
If you wanted to start with some source - where you'd want it, etc. - I'd be happy to contribute some authoring with comments as to why, or can start from scratch myself and contribute a PR.
I wonder how likely it is that this tool is or will ever be used on x86 and if the effort of spending resources on an x86 build/installer is worth it. IMO there might be a few exceptional cases of developers depending on x86 but is the ability to use this tool really crucial for them?
It's really not much effort at all. Like I did with PowerShell, a couple variables for a different UpgradeCode and architecture setting and the authoring can otherwise be the exact same source. That said, I agree support for x86 may be dubious, but if the CLI wants to support Windows 7 there were still quite a few customers (maybe not dev customers though) on x86.
To be honest, since your previous comment I was looking a bit into wixproj files and MSBuild, but having no experience with either and online guides suggesting I should use Visual Studio for all this, I think I was way in over my head.
Sure thing. Not blocking (we can always move it), but if you have some thought as to where to put the files. I will update the workflow to invoke it as well.
Feel free to put build stuff under script/. Also, our current release workflow is triggered by git tags, but in the interest of testing this Windows stuff in Actions without having to push new git tags, you could temporarily configure the Windows build workflow to be triggered on push or on workflow_dispatch.
bugSomething isn't workingpackagingpriority-2Affects more than a few users but doesn't prevent core functionswindowsRelated to Windows hosts or runners
Activity
mislav commentedon Mar 26, 2020
Thank you for reporting, and nice catch! I must admit I haven't tried changing the installation path when we initially tested the installer.
Our Windows release process is powered by go-msi, which in turn invokes WiX Toolset to create the MSI installer. So I suspect the bug with the changed path not being respected is in one of these projects.
The bug with amd64 binary defaulting to
C:\Program Files (x86)is most likely a separate issue and might come down to a configuration problem.We will look into this when we have a chance! If there is in the meantime a Windows person experienced with WiX who would like to take a look at this, please be our guest 🙇
igorakkerman commentedon Mar 26, 2020
Thanks, I just noticed that my original report listed wrong paths all over, fixed this now. I've looked into both go-msi and WiX prior to opening this issue but wasn't able to find any similar problems on their sides. Maybe someone else knows more :-)
darkred commentedon Sep 16, 2020
Just wanted to report that both issues of the OP are still present in today's first out of beta release 1.0.0 .
I'm sure the devs have this issue in mind,
it's just that those, like me, that install the first non beta version of GitHub CLI via gh_1.0.0_windows_amd64.msi ,
get the wrong impression that the installed
gh.exeis a x86 binary.Grrrrrrrrrrrrrrrr commentedon Jan 11, 2021
I am also having both these issues with the
gh_1.4.0_windows_amd64.msiinstaller.aravindvnair99 commentedon Feb 19, 2021
Continues in
v1.6.1as well.mislav commentedon Feb 22, 2021
Thanks for reporting, all. This is still an ongoing issue, as evident by this ticket still being open. We appreciate your patience while we address this.
bchadwic commentedon Jul 2, 2021
Not sure if this helps or not, but I installed
gh_1.12.1_windows_amd64.msion my personal and work computer in two alternative separate locations and the MSI worked as intended.darkred commentedon Jul 2, 2021
You mean locations different than
Program FilesandProgram Files (x86), e.g.C:\.Yes, I confirm that.
Because the OP still stands.
Using win10 x64 21H1, I just (uninstalled v1.12.0 x64 and) tried to install
gh_1.12.1_windows_amd64.msi:C:\Program Files (x86)\GitHub CLI(error 1)C:\Program Files\GitHub CLI, it installed it:C:\Program Files (x86)\GitHub CLI(error 2).bchadwic commentedon Jul 3, 2021
My apologies, I didn't test for that. Yeah that happens for me too. Default location is x86 on a win10 x64, and I can't successfully change it to Program Files. I'd like to look into this.
mislav commentedon Aug 16, 2021
@bchadwic The problem is in go-msi: https://github.com/mh-cbon/go-msi/blob/7f05345d485bba45400e3d82d46eaa067b47d652/templates/product.wxs#L3-L6
These directives switch between
Program Files (x86)andProgram Files. However, the resulting MSI will always be created withProgram Files (x86), even on a 64-bit system, due to the fact that it fails to callcandle(a utility that's part of the WiX toolset) with the-arch x64flag, and as a result always producing the installer that's hardcoded for 32-bit systems.It's a pretty deep problem and I think fixing that and related other MSI issues will require us to stop using go-msi and perhaps write XML by hand and interface with WiX Toolset directly.
bchadwic commentedon Aug 17, 2021
@mislav
I'm not sure how attached you all are to the WiX toolset but I built a inno setup installer tonight and I think it may solve a few of the MSI issues posted.
New features over the existing installer (correct me if I'm wrong):
Things that need to be added to the new installer:
if this is something that might interest the team, let me know and I'll continue to work on it.
https://github.com/bchadwic/gh-installer
8 remaining items
bchadwic commentedon Aug 23, 2021
@igorakkerman fair, however no one likes extra steps considering wix might not be all that bad.
I think I'll go ahead and finish out the inno setup prototype, which would include a licensing page, an automation shell script, and the feature that would uninstall a <1.14.x version if it is found on the system. Then I'll tag mislav to maybe get a better opinion on the subject
heaths commentedon Aug 25, 2021
I was a developer on WiX for many years and dealt with internal Windows Installer support for many more. The problem is that the MSI is built for x86 and
ProgramFilesFolderwill always be the x86 path even if you specify another directory because it gets redirected back. You need separate installers for x86 and x64, unfortunately.I can fix this so that the MSI is always x64, but I'm wondering if x86 support is even needed. I see it's in the general Windows support issue, so I'm assuming so. Fortunately, the winget package manifest schema can support both x86 and x64 so anyone using that will get the right one automatically.
To add, an x64 MSI can install to both 32- and 64-bit locations, but will fall to install at all on an x86 OS.
mislav commentedon Aug 25, 2021
@heaths It's great to hear you have WiX experience! I would love it if we could get to a point where we're generating separate MSI installers for x86 and x64. Then, the x64 installer could default to
C:\Program Filesinstead ofC:\Program Files (x86).The tricky part is, right now every x64 Windows user has GitHub CLI installed to
C:\Program Files (x86)\GitHub CLIbecause our installer is busted and they couldn't have changed the directory even if they tried. When we publish a fixed MSI installer for those platform, what should we do with the old directory? Should we have some explicit instructions in WiX XML files to clean up that directory if one is detected? Or is the process of upgrading the GitHub CLI version through MSI always going to clean up the previous version automatically?Second, what is the best way to enable the user to choose their install location for GitHub CLI and have it be remembered between upgrades? Is that done by writing a registry entry? We don't do that right now, but I think it would be necessary if we fix choosing the install location. No sense in being forced to choose the same install location over and over on every manual upgrade.
To drop our dependence to now-unmaintained go-msi, I've tried manually rolling a WiX XML file for the hub project, with intention to use this approach in GitHub CLI as well, but I got stuck somewhere and I don't remember where: https://github.com/github/hub/blob/windows-msi/script/windows-msi.wxs.tmpl
heaths commentedon Aug 25, 2021
Cleaning up the old install is easy. You just schedule
RemoveExistingProductsbeforeInstallInitialize. There's some other nuance I'd be happy to author including remembering the install location. Not sure if the current solution building the MSI will support that, but if needs be I can author a project and ask the support necessary. The build environment can be downloaded from NuGet, though I believewindows-latestincludes a recent WiX install anyway.For now, it's just an x64 binary, correct? Or are you building an x86 as well? The x64 MSI could install both. An x86 MSI can also be used to support ARM64 but if a native ARM64 binary is desirable, that will need to be a separate MSI still. I've been working with both the PowerShell team and my old team, the Visual Studio Installer team, on similar solutions.
mislav commentedon Aug 25, 2021
What do you mean? Are you suggesting that we publish a single x64 MSI that contains
gh.exebinaries for both architectures and is installable on 32-bit Windows?No, as I said, we'd have to drop go-msi from our release automation (it's a project that wraps creating WiX XML files and calling the WiX Toolset on it), so I was thinking of rolling an XML file by hand in a separate branch and inviting you to take a look at/collaborate on it.
Yeah, we'd just call
candleandlightin a GitHub Actions job on Windows.heaths commentedon Aug 25, 2021
No, an x64 MSI cannot install on x86. It can install binaries for both architectures, though. A separate MSI is needed for x86.
The key is fragments and not authoring component GUIDs. In most cases, the auto-GUIDing feature work correctly and avoid costly and confusing behaviors.
I recommend using a .wixproj and running MSBuils on that. Running candle and light - especially when multiple source files world be easier to manage - is doable but unnecessary. Projects make it easier, as well as adding in extensions out building chainers. For example, of you built a bundle, the x64 and/or x86 MSIs could be installed automatically based on the target system. Projects allow you to specify dependencies, infer build order, and even reference project variables in other projects.
heaths commentedon Aug 25, 2021
For context, here's a recent one waiting on a final review (review is vacationing but back soon): PowerShell/openssh-portable#521. It can produce both an x86- and x64-only MSI, though there's no current plans for x86 (but may be later, hence the support now). For an EXE, having both x86 and x64 doesn't really make sense and does make the authoring easier where you only have to condition whether to use
ProgramFilesFolderorProgramFiles64Folderto use in the default path, and theUpgradeCode. The rest of the authoring can pretty much be the same. The<Environment>to augment thePATHshould be put into the same component as the sole gh.exe since it's a versioned file and will auto-GUID correctly.The x86 and x64 MSIs should probably be mutually exclusive and there's a way to do that. That way, you don't have both in the
PATH. I suppose there's probably nothing terribly wrong with that, though.If you wanted to start with some source - where you'd want it, etc. - I'd be happy to contribute some authoring with comments as to why, or can start from scratch myself and contribute a PR.
igorakkerman commentedon Aug 31, 2021
I wonder how likely it is that this tool is or will ever be used on x86 and if the effort of spending resources on an x86 build/installer is worth it. IMO there might be a few exceptional cases of developers depending on x86 but is the ability to use this tool really crucial for them?
heaths commentedon Aug 31, 2021
It's really not much effort at all. Like I did with PowerShell, a couple variables for a different UpgradeCode and architecture setting and the authoring can otherwise be the exact same source. That said, I agree support for x86 may be dubious, but if the CLI wants to support Windows 7 there were still quite a few customers (maybe not dev customers though) on x86.
heaths commentedon Aug 31, 2021
@mislav if you'd prefer, I can start on authoring and submit a PR to collaborate on.
mislav commentedon Sep 1, 2021
@heaths That would be awesome, thank you. 🙇
To be honest, since your previous comment I was looking a bit into wixproj files and MSBuild, but having no experience with either and online guides suggesting I should use Visual Studio for all this, I think I was way in over my head.
heaths commentedon Sep 1, 2021
Sure thing. Not blocking (we can always move it), but if you have some thought as to where to put the files. I will update the workflow to invoke it as well.
mislav commentedon Sep 2, 2021
Feel free to put build stuff under
script/. Also, our current release workflow is triggered by git tags, but in the interest of testing this Windows stuff in Actions without having to push new git tags, you could temporarily configure the Windows build workflow to be triggered onpushor onworkflow_dispatch.Refactor Windows Installer setup