Skip to content

Commit

Permalink
Windows installer (#32)
Browse files Browse the repository at this point in the history
* Add Windows installer
  • Loading branch information
jfantinhardesty authored Nov 2, 2023
1 parent f9e66ae commit 16f3804
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ __debug_bin
**/var.ps1
*.prof
cpplite/
build/
test/manual_scripts/create1000.go
test/manual_scripts/cachetest.go
lint.log
Expand All @@ -31,4 +30,7 @@ cloudfuse-logs.txt
ui_*.py
test/scripts/dirIterate.go
**/logfile.txt
dist/
dist/
**/Output/
/gui/build/**
/build/winfsp-*
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Cloudfuse Changelog #

## 0.2.0 (WIP) ##

**Features**
-- Include an installer on Windows
-- Linux installers now include the GUI and add it to the user applications.

## 0.1.0 ##
Expand Down
2 changes: 2 additions & 0 deletions build/download_winfsp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
curl -LOf https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi
101 changes: 101 additions & 0 deletions build/windows_installer_build.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Cloudfuse"
#define MyAppVersion "0.1.0"
#define MyAppPublisher "Seagate Technology"
#define MyAppURL "https://github.com/Seagate/cloudfuse"
#define MyAppExeName "cloudfuseGUI.exe"
#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}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\Users\721190\code\cloudfuse\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

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\gui\dist\cloudfuseGUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\gui\dist\cloudfuseGUI\_internal\*"; DestDir: "{app}\_internal\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\cloudfuse.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\README.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleDataSetFuseConfig.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleFileCacheConfigAzure.yaml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleFileCacheConfigS3.yaml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleFileCacheWithSASConfigAzure.yaml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleStreamingConfigAzure.yaml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\sampleStreamingConfigS3.yaml"; DestDir: "{app}"; Flags: ignoreversion

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

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
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\memfs64') then
begin
if MsgBox('WinFSP is required for Cloudfuse. Do you want to install it now?', mbConfirmation, MB_YESNO) = idYes then
begin
if not Exec('msiexec.exe', '/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);
end;
end;
end;
// Add cloudfuse to the path
if not Exec('cmd.exe', '/C SETX PATH "%PATH%;' + ExpandConstant('{app}') + '" /M', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Failed to update PATH. You may need to add the path manually to use Cloudfuse on the command line.', mbError, MB_OK);
end;
// Install and start the Windows service
if not Exec('cmd.exe', '/C cloudfuse 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);
end;
if not Exec('cmd.exe', '/C cloudfuse service start', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Failed to start cloudfuse as a service. You may need to do this manually from the command line.', mbError, MB_OK);
end;
end;
end;

0 comments on commit 16f3804

Please sign in to comment.