2019-09-23 21:43:32 +01:00
<?xml version="1.0" encoding="UTF-8"?>
2019-11-15 14:37:29 +00:00
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
2019-10-29 19:31:20 +00:00
<Product Id="*" Name="Storj V3 Storage Node" Language="1033" Version="!(bind.FileVersion.Storagenodeexe)" Manufacturer="Storj Labs Inc." UpgradeCode="{B32CF5FC-0665-4712-B88A-22D299565F9E}">
2019-09-23 21:43:32 +01:00
<Package Platform="x64" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
2019-10-29 19:31:20 +00:00
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" Schedule="afterInstallExecute"/>
2019-09-23 21:43:32 +01:00
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="Storage Node" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
2019-10-29 19:31:20 +00:00
2019-09-23 21:43:32 +01:00
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="StorjFolder" Name="Storj">
<Directory Id="INSTALLFOLDER" Name="Storage Node" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="StorjStartMenuFolder" Name="Storj">
<Directory Id="StorageNodeStartMenuFolder" Name="Storage Node" />
</Directory>
</Directory>
<Directory Id="IDENTITYDIR" />
<Directory Id="STORAGEDIR" />
</Directory>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="Executable" Guid="{4571F06C-D46B-4AAF-B015-255311A5B404}" Win64='yes'>
<File Id='Storagenodeexe' Source="storagenode.exe" Name="storagenode.exe" />
<ServiceInstall
Id="StoragenodeService"
Type="ownProcess"
Name="storagenode"
DisplayName="Storj V3 Storage Node"
Description="Runs Storj V3 Storage Node as a background service."
Start="auto"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]"
ErrorControl="normal"
Arguments="run --config-dir "[INSTALLFOLDER]\""
2020-02-03 23:49:37 +00:00
>
<ServiceDependency Id="LanmanServer"/>
<ServiceDependency Id="Dnscache"/>
</ServiceInstall>
2019-11-15 14:37:29 +00:00
<ServiceControl Id="StoragenodeStartService" Start="install" Stop="both" Remove="both" Name="storagenode" Wait="yes" />
2019-09-23 21:43:32 +01:00
2020-05-26 15:43:41 +01:00
<fire:FirewallException Id="StoragenodePort" Name="storagenode.exe" Port="28967" Scope="any" IgnoreFailure="yes"/>
2019-09-23 21:43:32 +01:00
</Component>
<Component Id="ExecutableUpdater" Guid="{CBD06EA1-73F7-4B3E-9D31-EEB2A8175542}" Win64='yes'>
<File Id='Storagenodeupdaterexe' Source="storagenode-updater.exe" Name="storagenode-updater.exe" />
<ServiceInstall
Id="StoragenodeUpdaterService"
Type="ownProcess"
Name="storagenode-updater"
DisplayName="Storj V3 Storage Node Updater"
Description="Automatically updates the Storj V3 Storage Node service when a new version is available."
Start="auto"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]"
ErrorControl="normal"
2019-12-03 13:56:49 +00:00
Arguments="run --config-dir "[INSTALLFOLDER]\" --binary-location "[INSTALLFOLDER]storagenode.exe" --log.output "winfile:///[INSTALLFOLDER]storagenode-updater.log"">
2019-11-15 14:37:29 +00:00
<util:ServiceConfig
ServiceName="storagenode-updater"
ResetPeriodInDays="1"
RestartServiceDelayInSeconds="60"
FirstFailureActionType="restart"
SecondFailureActionType="runCommand"
ThirdFailureActionType="runCommand"
ProgramCommandLine="cmd /c "(echo %date% %time% recovery triggered to execute in 3 minutes && timeout 180 >NUL && echo %date% %time% recovery command executed: && copy /y "[INSTALLFOLDER]storagenode-updater.old.exe" "[INSTALLFOLDER]storagenode-updater.exe" && net start storagenode-updater) >> "[INSTALLFOLDER]storagenode-updater-recovery.log" 2>&1""
/>
2020-02-03 23:49:37 +00:00
<ServiceDependency Id="LanmanServer"/>
<ServiceDependency Id="Dnscache"/>
2019-11-15 14:37:29 +00:00
</ServiceInstall>
<ServiceControl Id="StoragenodeUpdaterStartService" Start="install" Stop="both" Remove="both" Name="storagenode-updater" Wait="yes" />
2019-09-23 21:43:32 +01:00
</Component>
<Component Id="dashboardShortcut" Guid="{C48A862E-869D-4FD4-A215-D47092A40BAA}" Win64="yes">
2019-10-08 08:23:49 +01:00
<!-- We use a standard shortcut to 'cmd.exe /C "start http://localhost:14002"' instead of util:InternetShortcut,
so it appears as an App Shortcut with icon in the Windows Start Menu. In contrast, InternetShortcut does
not support icons in the Start Menu. -->
<Shortcut Id="DashboardShortcut" Name="Storage Node Dashboard" Description="Open the dashboard for the storage node" Directory="StorageNodeStartMenuFolder" Target="[System64Folder]cmd.exe" Arguments="/C "start http://localhost:14002"">
2019-09-23 21:43:32 +01:00
<Icon Id="DashboardIco" SourceFile="storj.ico"/>
</Shortcut>
<RemoveFolder Id="RemoveStorageNodeMenuFolder" Directory="StorageNodeStartMenuFolder" On="uninstall" />
<RemoveFolder Id="RemoveStorjMenuFolder" Directory="StorjStartMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Storj\Storage Node" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
2019-10-29 19:31:20 +00:00
2019-09-23 21:43:32 +01:00
<Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
<Property Id="STORJ_STORAGEDIR">STORAGEDIR</Property>
<Property Id="STORJ_STORAGE">1.0</Property>
2019-10-10 14:51:45 +01:00
<Property Id="STORJ_IDENTITYDIR">IDENTITYDIR</Property>
<Property Id="STORJ_DEFAULTIDENTITYDIR">
2019-10-29 19:31:20 +00:00
<DirectorySearch Id='search1' Path='[PersonalFolder]' />
<DirectorySearch Id='search2' Path='[AppDataFolder]\Storj\Identity\storagenode'/>
</Property>
<Property Id="STORJ_SERVICE_COMMAND">
<RegistrySearch Id="ServiceCommand" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\storagenode" Name="ImagePath" Type="raw" />
2019-10-10 14:51:45 +01:00
</Property>
<SetDirectory Action="SetIdentityDir" Id="IDENTITYDIR" Value="[STORJ_DEFAULTIDENTITYDIR]" Sequence="first">STORJ_DEFAULTIDENTITYDIR</SetDirectory>
2019-10-29 19:31:20 +00:00
<SetDirectory Action="SetInstallFolder" Id="INSTALLFOLDER" Value="[STORJ_INSTALLDIR]" Sequence="execute">WIX_UPGRADE_DETECTED</SetDirectory>
2019-10-10 14:51:45 +01:00
<UIRef Id="CustomInstallDir" />
2019-10-09 14:13:05 +01:00
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open dashboard" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
2019-09-23 21:43:32 +01:00
<Icon Id="storj.ico" SourceFile="storj.ico"/>
<Property Id="ARPPRODUCTICON" Value="storj.ico" />
<WixVariable Id="WixUILicenseRtf" Value="agpl-3.0.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="banner.bmp" />
2019-11-01 16:42:30 +00:00
<WixVariable Id="WixUIDialogBmp" Value="dialog.png" />
2019-10-09 14:13:05 +01:00
<Property Id="WixShellExecTarget" Value='http://localhost:14002' />
<CustomAction Id="LaunchSNOBoard" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
2019-09-23 21:43:32 +01:00
<Binary Id="StorjDLL" SourceFile="$(var.Storj.TargetDir)Storj.CA.dll" />
2019-10-09 14:13:05 +01:00
2019-09-23 21:43:32 +01:00
<CustomAction Id='StoragenodeSetup' Directory='INSTALLFOLDER' Execute='deferred' Impersonate='no'
2020-02-12 21:19:42 +00:00
ExeCommand=""[INSTALLFOLDER]storagenode.exe" setup --config-dir "[INSTALLFOLDER]\" --identity-dir "[IDENTITYDIR]\" --operator.email "[STORJ_EMAIL]" --operator.wallet "[STORJ_WALLET]" --contact.external-address "[STORJ_PUBLIC_ADDRESS]" --storage.path "[STORAGEDIR]\" --storage.allocated-disk-space "[STORJ_STORAGE] TB" --log.output "winfile:///[INSTALLFOLDER]\storagenode.log"" />
2019-10-29 19:31:20 +00:00
<CustomAction Id="DeleteConfigFile" Directory='INSTALLFOLDER'
ExeCommand="cmd /C "del config.yaml"" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="ExtractInstallDir" BinaryKey="StorjDLL" DllEntry="ExtractInstallDir" Execute="immediate" Return="check" />
<CustomAction Id="BackupConfigFile" Directory='INSTALLFOLDER'
ExeCommand="cmd /C "move config.yaml config.yaml.bak"" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="RestoreConfigFile" Directory='INSTALLFOLDER'
ExeCommand="cmd /C "move config.yaml.bak config.yaml"" Execute="deferred" Return="check" Impersonate="no" />
2019-09-23 21:43:32 +01:00
<InstallExecuteSequence>
2019-10-29 19:31:20 +00:00
<Custom Action='StoragenodeSetup' Before='InstallServices'>NOT Installed AND NOT WIX_UPGRADE_DETECTED</Custom>
<Custom Action='DeleteConfigFile' After='RemoveFiles'>(REMOVE="ALL") AND NOT WIX_UPGRADE_DETECTED</Custom>
<!-- legacy: save config file as old versions of the installer will remove it -->
<Custom Action='ExtractInstallDir' Before='SetInstallFolder'>WIX_UPGRADE_DETECTED</Custom>
<Custom Action='BackupConfigFile' Before='InstallExecute'>WIX_UPGRADE_DETECTED</Custom>
<Custom Action='RestoreConfigFile' After='RemoveExistingProducts'>WIX_UPGRADE_DETECTED</Custom>
2019-09-23 21:43:32 +01:00
</InstallExecuteSequence>
</Product>
2019-10-09 14:13:05 +01:00
</Wix>