Skip to content

Commit

Permalink
Add installation without gui (#297)
Browse files Browse the repository at this point in the history
* New installers without GUI

* Enable Windows build without gui

* Add new command to add registry item for WinFSP

* Add no gui build, allow to build in quiet mode

* Fix release for no gui

* test release

* Cleanup from testing

* Cleanup leftover code

* Revert uncommented debugs

* Use name for gui, rather than no_gui option

* Revert "Use name for gui, rather than no_gui option"

This reverts commit 6acbc49.

* Fix install instructions
  • Loading branch information
jfantinhardesty authored Aug 6, 2024
1 parent 9b8abaf commit c887d84
Show file tree
Hide file tree
Showing 11 changed files with 386 additions and 13 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ jobs:
'sign /fd SHA256 /a /f $q${{ github.workspace }}\build\signingKey.pfx$q' \
'/n $qSEAGATE TECHNOLOGY LLC$q /t http://timestamp.digicert.com $p"' \
"windows_installer_build.iss"
-
name: Prep Inno Setup Script for No Gui
working-directory: ./build
shell: bash
# Inno Setup is pre-installed on GitHub's windows-latest image
# see documentation: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
run: |
printf '%s ' >run-iscc_no_gui.bat \
'"C:/Program Files (x86)/Inno Setup 6/iscc.exe"' \
'"/Ssigntool=$qC:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe$q' \
'sign /fd SHA256 /a /f $q${{ github.workspace }}\build\signingKey.pfx$q' \
'/n $qSEAGATE TECHNOLOGY LLC$q /t http://timestamp.digicert.com $p"' \
"windows_installer_build_no_gui.iss"
-
name: Run Inno Setup
working-directory: ./build
Expand All @@ -162,13 +175,33 @@ jobs:
name: Rename installer
run: |
mv build/Output/cloudfuse.exe build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
-
name: Run Inno Setup No Gui
working-directory: ./build
run: |
.\run-iscc_no_gui.bat
-
name: Set Version No Gui
id: get_version_no_gui
run: echo "::set-output name=VERSION::$( echo ${{github.ref_name}} | tr -d 'v' )"
-
name: Rename installer No Gui
run: |
mv build/Output/cloudfuse.exe build/Output/cloudfuse_no_gui_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
-
name: Cache windows installer
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
key: windows-cloudfuse-installer-${{ github.sha }}
-
name: Cache windows installer No GUi
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: build/Output/cloudfuse_no_gui_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
key: windows-cloudfuse-no-gui-installer-${{ github.sha }}

release:
# Use GoReleaser to package and publish Linux releases along with the Windows installer
Expand Down Expand Up @@ -219,6 +252,18 @@ jobs:
path: build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
key: windows-cloudfuse-installer-${{ github.sha }}
fail-on-cache-miss: true
-
name: Set Version No GUi
id: get_version_no_gui
run: echo "::set-output name=VERSION::$( echo ${{github.ref_name}} | tr -d 'v' )"
- # Get cached intermediate build products
name: Restore cached Windows installer No Gui
uses: actions/cache/restore@v4
with:
enableCrossOsArchive: true
path: build/Output/cloudfuse_no_gui_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe
key: windows-cloudfuse-no-gui-installer-${{ github.sha }}
fail-on-cache-miss: true
-
name: Restore Linux compiled GUI
uses: actions/cache/restore@v4
Expand Down
116 changes: 112 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ archives:
- linux-amd64
- linux-amd64-health-monitor
format: tar.gz

files:
- LICENSE
- README.md
Expand All @@ -147,11 +146,35 @@ archives:
- src: "sampleStreamingConfigAzure.yaml"
dst: "./samples/sampleStreamingConfigAzure.yaml"

- id: linux-arm64
- id: linux-amd64_no_gui
builds:
- linux-amd64
- linux-amd64-health-monitor
format: tar.gz
name_template: "{{ .ProjectName }}_no_gui_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
- NOTICE
- src: "setup/baseConfig.yaml"
dst: "./samples/baseConfig.yaml"
- src: "sampleFileCacheConfigAzure.yaml"
dst: "./samples/sampleFileCacheConfigAzure.yaml"
- src: "sampleFileCacheWithSASConfigAzure.yaml"
dst: "./samples/sampleFileCacheWithSASConfigAzure.yaml"
- src: "sampleFileCacheConfigS3.yaml"
dst: "./samples/sampleFileCacheConfigS3.yaml"
- src: "sampleStreamingConfigS3.yaml"
dst: "./samples/sampleStreamingConfigS3.yaml"
- src: "sampleStreamingConfigAzure.yaml"
dst: "./samples/sampleStreamingConfigAzure.yaml"

- id: linux-arm64_no_gui
builds:
- linux-arm64
- linux-arm64-health-monitor
format: tar.gz
name_template: "{{ .ProjectName }}_no_gui_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
Expand Down Expand Up @@ -194,12 +217,36 @@ archives:
- src: "sampleStreamingConfigAzure.yaml"
dst: "./samples/sampleStreamingConfigAzure.yaml"

- id: windows_no_gui
builds:
- windows
- windows-health-monitor
format: zip
name_template: "{{ .ProjectName }}_no_gui_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
- NOTICE
- src: "setup/baseConfig.yaml"
dst: "./samples/baseConfig.yaml"
- src: "sampleFileCacheConfigAzure.yaml"
dst: "./samples/sampleFileCacheConfigAzure.yaml"
- src: "sampleFileCacheWithSASConfigAzure.yaml"
dst: "./samples/sampleFileCacheWithSASConfigAzure.yaml"
- src: "sampleFileCacheConfigS3.yaml"
dst: "./samples/sampleFileCacheConfigS3.yaml"
- src: "sampleStreamingConfigS3.yaml"
dst: "./samples/sampleStreamingConfigS3.yaml"
- src: "sampleStreamingConfigAzure.yaml"
dst: "./samples/sampleStreamingConfigAzure.yaml"

release:
extra_files:
- glob: ./build/Output/cloudfuse_{{.Version}}_windows_amd64.exe
- glob: ./build/Output/cloudfuse_no_gui_{{.Version}}_windows_amd64.exe

nfpms:
- id: default
- id: linux

# Name of the package.
package_name: cloudfuse
Expand All @@ -208,7 +255,6 @@ nfpms:
# Defaults empty, which means no filtering.
builds:
- linux-amd64
- linux-arm64

vendor: Seagate Technology
homepage: https://github.com/Seagate/cloudfuse
Expand Down Expand Up @@ -265,5 +311,67 @@ nfpms:
dependencies:
- fuse-devel

- id: linux_no_gui

# Name of the package.
package_name: cloudfuse

# Build IDs for the builds you want to create NFPM packages for.
# Defaults empty, which means no filtering.
builds:
- linux-amd64
- linux-arm64
file_name_template: "{{ .ProjectName }}_no_gui_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

vendor: Seagate Technology
homepage: https://github.com/Seagate/cloudfuse
maintainer: https://github.com/Seagate/cloudfuse
description: |-
A FUSE filesystem for interacting with S3 and Azure storage.
license: MIT

# Formats to be generated.
formats:
- deb
- rpm

section: default

provides:
- cloudfuse
- cfusemon

# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
# Basic file that applies to all packagers
- src: './dist/linux-{{ .Arch }}-health-monitor_linux_{{ .Arch }}{{- if eq .Arch "amd64" }}_{{ .Amd64 }}{{- else }}{{ end }}/cfusemon'
dst: /usr/bin/cfusemon
- src: NOTICE
dst: /usr/share/doc/cloudfuse/NOTICE
- src: LICENSE
dst: /usr/share/doc/cloudfuse/LICENSE
- src: setup/baseConfig.yaml
dst: /usr/share/doc/cloudfuse/examples/baseConfig.yaml
- src: sampleFileCacheConfigAzure.yaml
dst: /usr/share/doc/cloudfuse/examples/sampleFileCacheConfigAzure.yaml
- src: sampleFileCacheConfigS3.yaml
dst: /usr/share/doc/cloudfuse/examples/sampleFileCacheConfigS3.yaml
- src: sampleFileCacheWithSASConfigAzure.yaml
dst: /usr/share/doc/cloudfuse/examples/sampleFileCacheWithSASConfigAzure.yaml
- src: sampleStreamingConfigS3.yaml
dst: /usr/share/doc/cloudfuse/examples/sampleStreamingConfigS3.yaml
- src: sampleStreamingConfigAzure.yaml
dst: /usr/share/doc/cloudfuse/examples/sampleStreamingConfigAzure.yaml

overrides:
deb:
dependencies:
- libfuse-dev

rpm:
dependencies:
- fuse-devel

metadata:
mod_timestamp: "{{ .CommitTimestamp }}"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Cloudfuse supports clouds with an S3 or Azure interface.

## Installation

Cloudfuse includes two types of installers. The default "cloudfuse" and the "cloudfuse_no_gui" option. The "no_gui" option includes only the cloudfuse CLI tool and will not install the GUI and on Windows it will additionally not install the startup tool which automatically restarts existing mounts on reboot. The "no_gui" installer is significantly smaller and suitable for those who only want the CLI tool. Most users should pick the default "cloudfuse" installer.

### Windows

Download and run the .exe installer from our latest release [here](https://github.com/Seagate/cloudfuse/releases). Uncheck the "Launch Cloudfuse" upon finishing the installation. Run the GUI separately as admin after the install completes.
Expand Down
8 changes: 4 additions & 4 deletions build/windows_installer_build.iss
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ begin
// Install WinFSP if it is not already installed
if not RegKeyExists(HKLM, 'SOFTWARE\WOW6432Node\WinFsp\Services') then
begin
if MsgBox('WinFSP is required for Cloudfuse. Do you want to install it now?', mbConfirmation, MB_YESNO) = idYes then
if SuppressibleMsgBox('WinFSP is required for Cloudfuse. Do you want to install it now?', mbConfirmation, MB_YESNO, IDYES) = IDYES then
begin
if not Exec('msiexec.exe', '/i "' + ExpandConstant('{app}\{#WinFSPInstaller}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
if not Exec('msiexec.exe', '/qn /i "' + ExpandConstant('{app}\{#WinFSPInstaller}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Failed to run the WinFSP installer. You might need to install it manually.', mbError, MB_OK);
SuppressibleMsgBox('Failed to run the WinFSP installer. You might need to install it manually.', mbError, MB_OK, IDOK);
end;
end;
end;
// Install the Cloudfuse Startup Tool
if not Exec(ExpandConstant('{app}\{#MyAppExeCLIName}'), 'service install', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Failed to install cloudfuse as a service. You may need to do this manually from the command line.', mbError, MB_OK);
SuppressibleMsgBox('Failed to install cloudfuse as a service. You may need to do this manually from the command line.', mbError, MB_OK, IDOK);
end;
end;
end;
Expand Down
111 changes: 111 additions & 0 deletions build/windows_installer_build_no_gui.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!:
; https://jrsoftware.org/ishelp/index.php

#define MyAppName "Cloudfuse"
#define MyAppVersion "1.3.2"
#define MyAppPublisher "SEAGATE TECHNOLOGY LLC"
#define MyAppURL "https://github.com/Seagate/cloudfuse"
#define MyAppExeCLIName "cloudfuse.exe"
#define WinFSPInstaller "winfsp-2.0.23075.msi"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C745CCCB-E042-4C42-852C-2FE1D287C38B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=..\LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=commandline
OutputBaseFilename=cloudfuse
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64
SignTool=signtool /d $q{#MyAppName} v{#MyAppVersion}$q $f
SignedUninstaller=yes
VersionInfoVersion={#MyAppVersion}
; Tell Windows Explorer to reload the environment
ChangesEnvironment=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Dirs]
; Create directory in AppData/Roaming
Name: "{userappdata}\{#MyAppName}"; Flags: uninsalwaysuninstall

[Files]
Source: "..\cloudfuse.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\cfusemon.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\README.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\setup\baseConfig.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
Source: "..\sampleFileCacheConfigAzure.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
Source: "..\sampleFileCacheConfigS3.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
Source: "..\sampleFileCacheWithSASConfigAzure.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
Source: "..\sampleStreamingConfigAzure.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
Source: "..\sampleStreamingConfigS3.yaml"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion
; Deploy default config
Source: "..\sampleFileCacheConfigS3.yaml"; DestDir: "{userappdata}\{#MyAppName}"; DestName: "config.yaml"; Flags: onlyifdoesntexist

Source: "..\winfsp-2.0.23075.msi"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \
Check: NeedsAddPath('{app}')

[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;
var
ResultCode: Integer;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
// Install WinFSP if it is not already installed
if not RegKeyExists(HKLM, 'SOFTWARE\WOW6432Node\WinFsp\Services') then
begin
if SuppressibleMsgBox('WinFSP is required for Cloudfuse. Do you want to install it now?', mbConfirmation, MB_YESNO, IDYES) = IDYES then
begin
if not Exec('msiexec.exe', '/qn /i "' + ExpandConstant('{app}\{#WinFSPInstaller}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
SuppressibleMsgBox('Failed to run the WinFSP installer. You might need to install it manually.', mbError, MB_OK, IDOK);
end;
end;
end;
// Install the Cloudfuse Startup Tool
if not Exec(ExpandConstant('{app}\{#MyAppExeCLIName}'), 'service install', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
SuppressibleMsgBox('Failed to install cloudfuse as a service. You may need to do this manually from the command line.', mbError, MB_OK, IDOK);
end;
end;
end;
Loading

0 comments on commit c887d84

Please sign in to comment.