diff --git a/.gitignore b/.gitignore index b41f4cc5e..c954ff898 100755 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ __debug_bin **/var.ps1 *.prof cpplite/ -build/ test/manual_scripts/create1000.go test/manual_scripts/cachetest.go lint.log @@ -31,4 +30,7 @@ cloudfuse-logs.txt ui_*.py test/scripts/dirIterate.go **/logfile.txt -dist/ \ No newline at end of file +dist/ +**/Output/ +/gui/build/** +/build/winfsp-* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 917a41b9f..1c1b84e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ## diff --git a/build/download_winfsp.sh b/build/download_winfsp.sh new file mode 100644 index 000000000..706bc24fb --- /dev/null +++ b/build/download_winfsp.sh @@ -0,0 +1,2 @@ +#!/bin/bash +curl -LOf https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi \ No newline at end of file diff --git a/build/windows_installer_build.iss b/build/windows_installer_build.iss new file mode 100644 index 000000000..a6f9bb485 --- /dev/null +++ b/build/windows_installer_build.iss @@ -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; +