Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Build release binary
shell: pwsh
run: |
cargo build -p gitcomet-app --release --locked --features ui-gpui,gix
cargo build -p gitcomet-app --release --locked --features ui-gpui,gix --bins

- name: Package portable ZIP
shell: pwsh
Expand All @@ -144,7 +144,7 @@ jobs:
$ErrorActionPreference = "Stop"
choco install wixtoolset --version "${env:WIXTOOLSET_VERSION}" --yes --no-progress
cargo install cargo-wix --version "${env:CARGO_WIX_VERSION}" --locked
if (!(Test-Path "wix\main.wxs")) {
if (!(Test-Path "crates\gitcomet-app\wix\main.wxs")) {
cargo wix init --package gitcomet-app
}
$msiName = "gitcomet-v${env:VERSION}-windows-x86_64.msi"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ local_*.sh
tmp/*
feat/*
.autoresearch/*
dist/
33 changes: 33 additions & 0 deletions crates/gitcomet-app/src/bin/gitcomet-launcher.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#![cfg_attr(target_os = "windows", windows_subsystem = "windows")]

#[cfg(target_os = "windows")]
fn main() {
use std::env;
use std::os::windows::process::CommandExt;
use std::process::Command;

// Prevent the console-subsystem app from creating a visible terminal window
// when launched from Start Menu shortcuts.
const CREATE_NO_WINDOW: u32 = 0x0800_0000;

let Ok(current_exe) = env::current_exe() else {
return;
};
let Some(install_dir) = current_exe.parent() else {
return;
};
let app_exe = install_dir.join("gitcomet-app.exe");

let mut cmd = Command::new(app_exe);
cmd.current_dir(install_dir);
cmd.creation_flags(CREATE_NO_WINDOW);
cmd.args(env::args_os().skip(1));

let _ = cmd.spawn();
}

#[cfg(not(target_os = "windows"))]
fn main() {
eprintln!("gitcomet-launcher is only supported on Windows");
std::process::exit(1);
}
144 changes: 144 additions & 0 deletions crates/gitcomet-app/wix/main.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version='1.0' encoding='windows-1252'?>
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='*'
Name='GitComet'
UpgradeCode='{3A9166E5-EB30-45B6-8128-C19FEA3A26DF}'
Manufacturer='AutoExplore Oy'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>

<Package
Id='*'
Keywords='Installer'
Description='GitComet desktop application'
Manufacturer='AutoExplore Oy'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'/>

<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>

<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='GitComet Installation'/>

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name='GitComet'>
<Component Id='License' Guid='*'>
<File
Id='LicenseFile'
Name='LICENSE-AGPL-3.0'
DiskId='1'
Source='LICENSE-AGPL-3.0'
KeyPath='yes'/>
</Component>

<Directory Id='Bin' Name='bin'>
<Component Id='Path' Guid='{206A9CFD-BF69-4386-851B-D88EECA93314}' KeyPath='yes'>
<Environment
Id='PATH'
Name='PATH'
Value='[Bin]'
Permanent='no'
Part='last'
Action='set'
System='yes'/>
</Component>

<Component Id='MainBinary' Guid='*'>
<File
Id='MainExeFile'
Name='gitcomet-app.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\gitcomet-app.exe'
KeyPath='yes'/>
</Component>

<Component Id='LauncherBinary' Guid='*'>
<File
Id='LauncherExeFile'
Name='GitComet.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\gitcomet-launcher.exe'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>

<Directory Id='ProgramMenuFolder'>
<Directory Id='GitCometProgramMenuDir' Name='GitComet'>
<Component Id='StartMenuShortcut' Guid='*'>
<Shortcut
Id='GitCometStartMenuShortcut'
Directory='GitCometProgramMenuDir'
Name='GitComet'
Description='Git GUI built with GPUI'
Target='[Bin]GitComet.exe'
WorkingDirectory='APPLICATIONFOLDER'
Icon='ProductICO'
IconIndex='0'
Advertise='no'/>
<RemoveFolder Id='RemoveGitCometProgramMenuDir' Directory='GitCometProgramMenuDir' On='uninstall'/>
<RegistryValue
Root='HKCU'
Key='Software\AutoExplore\GitComet'
Name='StartMenuShortcut'
Type='integer'
Value='1'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>

<Feature
Id='Binaries'
Title='Application'
Description='Installs all binaries and the license.'
Level='1'
ConfigurableDirectory='APPLICATIONFOLDER'
AllowAdvertise='no'
Display='expand'
Absent='disallow'>
<ComponentRef Id='License'/>
<ComponentRef Id='MainBinary'/>
<ComponentRef Id='LauncherBinary'/>
<ComponentRef Id='StartMenuShortcut'/>

<Feature
Id='Environment'
Title='PATH Environment Variable'
Description='Add the install location of the [ProductName] executable to the PATH system environment variable.'
Level='1'
Absent='allow'>
<ComponentRef Id='Path'/>
</Feature>
</Feature>

<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>

<Icon Id='ProductICO' SourceFile='assets\\gitcomet.ico'/>
<Property Id='ARPPRODUCTICON' Value='ProductICO'/>
<Property Id='ARPHELPLINK' Value='https://github.com/Auto-Explore/GitComet'/>

<UI>
<UIRef Id='WixUI_FeatureTree'/>
<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>
<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>
</UI>
</Product>
</Wix>

9 changes: 0 additions & 9 deletions dist/gitcomet.desktop

This file was deleted.

1 change: 1 addition & 0 deletions scripts/test_windows_installer.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cargo wix crates\gitcomet-app\Cargo.toml -p gitcomet-app --profile release --nocapture --output dist\gitcomet-local-test.msi
Loading