Windows Installer Contributor Guide
You need a system running a Windows OS or run a Windows VM.
If you choose the option with Windows VM, it is easiest to run it in VirtualBox. Box is usually available in the package manager of major Linux distro. Alternatively, it can be downloaded and installed from the official web site: https://www.virtualbox.org/
Once Virtual Box is installed, you need to download a VM archive from the Microsoft web site and import it in VirtualBox:
- Go to https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
- Select
MS Edge on Win 10 (x64)
for Virtual Machine - Select
VirtualBox
for Platform - Download the .ZIP archive
- Extract the archive
- Start VirtualBox
- Select
File > Import Appliance...
from the main menu - Browse the location of the
.ova
file you extracted from the .ZIP archive - Click the
Next >
button - Review the Appliance Settings
- Click the
Import
button - After import finishes, the new VM will appear in the main list of VirtualBox
- Double click on it to start it
- Use the default password
Passw0rd!
to login
The easiest way to transfer file between the host system and the Windows VM is using Shared Folders.
To setup a shared folder:
- Stop the Windows VM if it is already started
- Right-click on the Windows VM in VirtualBox
- Select
Settings...
- Select
Shared Folder
- Click on the button with Plus sign
- Browse a Folder Path from the host system
- Enter a Folder Name
- Select the
Auto-mount
checkbox - Click
OK
to add the shared folder - Click
OK
to close the Settings dialog - Start the Windows VM
- Open Windows Explorer
- Find the shared folder under
Network > VBOXSRV
- You may see an error dialog that the Network Discovery is turned off. Turn it on from the prompt in Windows Explorer and try again.
The minimum size of the storage partition is set to 500 GB and the default allocated space is set to 1 TB. If you don't have a partition with enough space, you can create a dynamically-allocated VDI disk image and attach it your VM.
- Right-click on the Windows VM in VirtualBox
- Select
Settings...
- Select
Storage
- Click on the '+' icon to create a new controller
- Right click on the newly created controller and select
add a hard drive
- Select "create a new disk"
- As disk type, select VDI
- Choose "dynamically allocated"
- Select the desired size (2 TB) and confirm
To be able to use the disk, you need to create a NTFS partition using the windows disk management panel.
On your Windows VM/system, install the following tools:
- Microsoft Dot Net Framework 3.5 from https://www.microsoft.com/en-us/download/confirmation.aspx?id=21 (it's required by Wix Toolset, see issue: https://github.com/wixtoolset/issues/issues/5523).
- Latest WiX Toolset 3.x from https://wixtoolset.org/
- Visual Studio 2019 Community: https://visualstudio.microsoft.com/downloads/
- It comes with a free license. After the 30 days trial, you will be asked to sign-in with your Microsoft account (which is free to create) and you will be able to continue using it for free.
- Wix Toolset Visual Studio 2019 Extension: https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension
- Git for Windows: https://git-scm.com/downloads
You need to build the Storage Node Binaries for Windows to include them in the project of the Windows Installer. You also have to tag a version, as the version of the Windows Installer is bound to the version of the Storage Node binary.
The easiest way to do this is to execute the following three commands in the root of the locally cloned https://github.com/storj/storj repository, assuming you are compiling version v1.2.3:
git tag v1.2.3
make storagenode_windows_amd64
make storagenode-updater_windows_amd64
Rename the result binaries to storagenode.exe
and storagenode-updater.exe
respectively and copy them to the Windows VM.
On the Windows VM:
- Clone the https://github.com/storj/storj repository
- Copy the
storagenode.exe
andstoragenode-updater.exe
toinstaller\windows
- Open Visual Studio
- Open the
installer/windows/windows.sln
solution file
In Visual Studio:
- Open the
installer\windows\windows.sln
solution file - Select
Build > Rebuild Solution
from the main menu - The result
storagenode.msi
can be found ininstaller\windows\bin\Debug
If anything fails while running the Windows Installer, the displayed error message is usually not helpful. It helps if running the installer with redirected logs to a file.
To do so, open a Command Prompt and run the installer with the following command:
msiexec /i storagenode.msi /l*v debug.log
The logs will be written to the debug.log
file.
- WiX Toolset Tutorial: https://www.firegiant.com/wix/tutorial/
- WiX Cookbook: https://www.allitebooks.in/wix-cookbook/