storj/installer/windows/Product.wxs
2019-10-21 11:22:54 -07:00

116 lines
6.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension">
<Product Id="{E97D368F-CB18-45B5-8799-1EBB10728A99}" Name="Storj V3 Storage Node" Language="1033" Version="0.0.0" Manufacturer="Storj Labs Inc." UpgradeCode="{B32CF5FC-0665-4712-B88A-22D299565F9E}">
<Package Platform="x64" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="Storage Node" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<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 &quot;[INSTALLFOLDER]\&quot;"
/>
<ServiceControl Id="StoragenodeStartService" Start="install" Stop="both" Remove="uninstall" Name="storagenode" Wait="yes" />
<fire:FirewallException Id="StoragenodePort" Name="storagenode.exe" Port="28967" Scope="any"/>
</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"
Arguments="run --config-dir &quot;[INSTALLFOLDER]\&quot; --binary-location &quot;[INSTALLFOLDER]\storagenode.exe&quot; --log &quot;[INSTALLFOLDER]\storagenode-updater.log&quot;"
/>
<ServiceControl Id="StoragenodeUpdaterStartService" Start="install" Stop="both" Remove="uninstall" Name="storagenode-updater" Wait="yes" />
</Component>
<Component Id="RemoveFiles" Guid="{26A01B8E-A9F3-4BF8-9FFC-50CDE0A4DF68}" Win64="yes">
<RemoveFile Id="ConfigFile" Name="config.yaml" On="uninstall" />
</Component>
<Component Id="dashboardShortcut" Guid="{C48A862E-869D-4FD4-A215-D47092A40BAA}" Win64="yes">
<!-- 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 &quot;start http://localhost:14002&quot;">
<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>
<Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
<Property Id="STORJ_STORAGEDIR">STORAGEDIR</Property>
<Property Id="STORJ_STORAGE">1.0</Property>
<Property Id="STORJ_BANDWIDTH">2.0</Property>
<Property Id="STORJ_IDENTITYDIR">IDENTITYDIR</Property>
<Property Id="STORJ_DEFAULTIDENTITYDIR">
<DirectorySearch Id='search1' Path='[PersonalFolder]' />
<DirectorySearch Id='search2' Path='[AppDataFolder]\Storj\Identity\storagenode'/>
</Property>
<SetDirectory Action="SetIdentityDir" Id="IDENTITYDIR" Value="[STORJ_DEFAULTIDENTITYDIR]" Sequence="first">STORJ_DEFAULTIDENTITYDIR</SetDirectory>
<UIRef Id="CustomInstallDir" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open dashboard" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<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" />
<WixVariable Id="WixUIDialogBmp" Value="dialog.bmp" />
<Property Id="WixShellExecTarget" Value='http://localhost:14002' />
<CustomAction Id="LaunchSNOBoard" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<Binary Id="StorjDLL" SourceFile="$(var.Storj.TargetDir)Storj.CA.dll" />
<CustomAction Id='StoragenodeSetup' Directory='INSTALLFOLDER' Execute='deferred' Impersonate='no'
ExeCommand="&quot;[INSTALLFOLDER]storagenode.exe&quot; setup --config-dir &quot;[INSTALLFOLDER]\&quot; --identity-dir &quot;[IDENTITYDIR]\&quot; --kademlia.operator.email &quot;[STORJ_EMAIL]&quot; --kademlia.operator.wallet &quot;[STORJ_WALLET]&quot; --kademlia.external-address &quot;[STORJ_PUBLIC_ADDRESS]&quot; --storage.path &quot;[STORAGEDIR]\&quot; --storage.allocated-bandwidth &quot;[STORJ_BANDWIDTH] TB&quot; --storage.allocated-disk-space &quot;[STORJ_STORAGE] TB&quot; --log.output &quot;winfile:///[INSTALLFOLDER]\storagenode.log&quot;"
/>
<InstallExecuteSequence>
<Custom Action='StoragenodeSetup' Before='InstallServices'>NOT Installed</Custom>
</InstallExecuteSequence>
</Product>
</Wix>