Skip to content

Windows Installer Contributor Guide

Fadila edited this page Nov 6, 2019 · 4 revisions

Windows Installer Contributor Guide

Setup Windows

You need a system running a Windows OS or run a Windows VM.

Install VirtualBox

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/

Install the Windows VM

Once Virtual Box is installed, you need to download a VM archive from the Microsoft web site and import it in VirtualBox:

  1. Go to https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
  2. Select MS Edge on Win 10 (x64) for Virtual Machine
  3. Select VirtualBox for Platform
  4. Download the .ZIP archive
  5. Extract the archive
  6. Start VirtualBox
  7. Select File > Import Appliance... from the main menu
  8. Browse the location of the .ova file you extracted from the .ZIP archive
  9. Click the Next > button
  10. Review the Appliance Settings
  11. Click the Import button
  12. After import finishes, the new VM will appear in the main list of VirtualBox
  13. Double click on it to start it
  14. Use the default password Passw0rd! to login

Setup Shared Folders

The easiest way to transfer file between the host system and the Windows VM is using Shared Folders.

To setup a shared folder:

  1. Stop the Windows VM if it is already started
  2. Right-click on the Windows VM in VirtualBox
  3. Select Settings...
  4. Select Shared Folder
  5. Click on the button with Plus sign
  6. Browse a Folder Path from the host system
  7. Enter a Folder Name
  8. Select the Auto-mount checkbox
  9. Click OK to add the shared folder
  10. Click OK to close the Settings dialog
  11. Start the Windows VM
  12. Open Windows Explorer
  13. 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.

Setup storage disk

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.

  1. Right-click on the Windows VM in VirtualBox
  2. Select Settings...
  3. Select Storage
  4. Click on the '+' icon to create a new controller
  5. Right click on the newly created controller and select add a hard drive
  6. Select "create a new disk"
  7. As disk type, select VDI
  8. Choose "dynamically allocated"
  9. 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.

Setup Dev Tools

On your Windows VM/system, install the following tools:

  1. 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).
  2. Latest WiX Toolset 3.x from https://wixtoolset.org/
  3. 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.
  4. Wix Toolset Visual Studio 2019 Extension: https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension
  5. Git for Windows: https://git-scm.com/downloads

Build Storage Node Binaries for Windows

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.

Setup the Windows Installer project

On the Windows VM:

  1. Clone the https://github.com/storj/storj repository
  2. Copy the storagenode.exe and storagenode-updater.exe to installer\windows
  3. Open Visual Studio
  4. Open the installer/windows/windows.sln solution file

Build the Windows Installer

In Visual Studio:

  1. Open the installer\windows\windows.sln solution file
  2. Select Build > Rebuild Solution from the main menu
  3. The result storagenode.msi can be found in installer\windows\bin\Debug

Troubleshooting the Windows Installer

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.

Further Reading