diff --git a/.gitignore b/.gitignore index 731ac7fa10..f4ee3a889a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ Char *.dmg /scripts/mac_installer/icon.iconset/ releaseChangelog.md +skywire.msi diff --git a/Makefile b/Makefile index ef2b71ec15..a5a1024495 100644 --- a/Makefile +++ b/Makefile @@ -260,6 +260,9 @@ mac-installer: ## Create signed and notarized application, run make mac-installe mac-installer-help: ## Show installer creation help ./scripts/mac_installer/create_installer.sh -h +win-installer: + @powershell '.\scripts\win_installer\script.ps1' + help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/_apps/skychat b/_apps/skychat deleted file mode 100755 index 76d099cc34..0000000000 --- a/_apps/skychat +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -go run $HOME/go/src/github.com/skycoin/skywire/cmd/apps/skychat/chat.go diff --git a/_apps/skysocks b/_apps/skysocks deleted file mode 100755 index 6c977f6a40..0000000000 --- a/_apps/skysocks +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -go run $HOME/go/src/github.com/skycoin/skywire/cmd/apps/skysocks/skysocks.go diff --git a/_apps/skysocks-client b/_apps/skysocks-client deleted file mode 100755 index 032d4d206c..0000000000 --- a/_apps/skysocks-client +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -go run $HOME/go/src/github.com/skycoin/skywire/cmd/apps/skysocks-client/skysocks-client.go diff --git a/_apps/vpn-client b/_apps/vpn-client deleted file mode 100755 index 2c700af3b6..0000000000 --- a/_apps/vpn-client +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -go run $HOME/go/src/github.com/skycoin/skywire/cmd/apps/vpn-client/vpn-client.go diff --git a/_apps/vpn-server b/_apps/vpn-server deleted file mode 100755 index cfdd994174..0000000000 --- a/_apps/vpn-server +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -go run $HOME/go/src/github.com/skycoin/skywire/cmd/apps/vpn-server/vpn-server.go diff --git a/scripts/win_installer/README.md b/scripts/win_installer/README.md new file mode 100644 index 0000000000..a7c865fc7b --- /dev/null +++ b/scripts/win_installer/README.md @@ -0,0 +1,32 @@ +## Windows installer + +### Requirments +- windows machine +- Install **chocolatey** by its instruction [here](https://chocolatey.org/install). +- Install **GNU Make** by choco + ``` + choco install make + ``` +- Install **go-msi** by choco + ``` + choco install go-msi + ``` +- Download and Install **Wix** from [here](https://github.com/wixtoolset/wix3/releases/tag/wix3112rtm). + - Need to add `C:\Program Files (x86)\WiX Toolset v3.11\bin` to path. +- We need to install **.Net Framework 3.5 SP1**, you can download and install from [here](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net35-sp1-web-installer). + +### Build +You can build **skywire.msi** by +``` +make win-installer +``` + +### Install +Double click the created installer to install skywire. + +### Run +To run skywire open a terminal or cmd window and run +``` +skywire +``` +or open `skywire` shortcut on start menu. diff --git a/scripts/win_installer/ico.ico b/scripts/win_installer/ico.ico new file mode 100644 index 0000000000..cc325fd3cb Binary files /dev/null and b/scripts/win_installer/ico.ico differ diff --git a/scripts/win_installer/script.ps1 b/scripts/win_installer/script.ps1 new file mode 100644 index 0000000000..13ab29adcb --- /dev/null +++ b/scripts/win_installer/script.ps1 @@ -0,0 +1,21 @@ +echo "Building Systray Windows Binaries..." +if (Test-Path ".\skywire.msi") { Remove-Item ".\skywire.msi" -Recurse -Force} +make build-systray-windows > $null +echo "Build Complete!" +echo "Setting go-msi configuration..." +cd .\scripts\win_installer +if (Test-Path ".\build") { Remove-Item ".\build" -Recurse -Force} +mkdir -p ".\build\amd64\apps" > $null +mv ..\..\skywire-visor.exe .\build\amd64\skywire-visor.exe +mv ..\..\skywire-cli.exe .\build\amd64\skywire-cli.exe +mv ..\..\apps\vpn-client .\build\amd64\apps\vpn-client.exe +rm ..\..\setup-node.exe +rm -r -fo ..\..\apps +cp skywire.bat .\build\amd64\skywire.bat +echo "Configuration complete!" +echo "Building msi..." +go-msi make --msi skywire.msi --version 0.5.1 --arch amd64 +mv skywire.msi ../../skywire.msi +Remove-Item ".\build" -Recurse -Force +cd ../../ +echo "Build Complete!" diff --git a/scripts/win_installer/skywire.bat b/scripts/win_installer/skywire.bat new file mode 100644 index 0000000000..21f4156339 --- /dev/null +++ b/scripts/win_installer/skywire.bat @@ -0,0 +1,12 @@ +@Echo Off +%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit +cd /d "%~dp0" +if not exist "apps\" ( + mkdir apps + move vpn-client.exe apps +) +if not exist "%HOMEPATH%\skywire-config.json" ( +skywire-cli config gen -biro "%HOMEPATH%\skywire-config.json" --os windows --disable-apps skychat,skysocks,skysocks-client,vpn-server +) +start "" http://127.0.0.1:8000 +skywire-visor.exe -c "%HOMEPATH%\skywire-config.json" diff --git a/scripts/win_installer/wix.json b/scripts/win_installer/wix.json new file mode 100644 index 0000000000..ef667d0a2d --- /dev/null +++ b/scripts/win_installer/wix.json @@ -0,0 +1,47 @@ +{ + "product": "Skywire", + "company": "Skycoin", + "upgrade-code": "", + "files": { + "guid": "", + "items": [ + "build/amd64/skywire-cli.exe", + "build/amd64/skywire-visor.exe", + "build/amd64/apps/vpn-client.exe", + "build/amd64/skywire.bat", + "ico.ico" + ] + }, + "env": { + "guid": "", + "vars": [ + { + "name": "PATH", + "value": "[INSTALLDIR]", + "permanent": "yes", + "system": "yes", + "action": "set", + "part": "last" + } + ] + }, + "shortcuts": { + "guid": "", + "items": [ + { + "name": "Skywire", + "description": "run skywire", + "target": "[INSTALLDIR]\\skywire.bat", + "wdir": "INSTALLDIR", + "icon":"ico.ico" + } + ] + }, + "hooks": [ ], + "choco": { + "description": "skywire", + "project-url": "https://github.com/skycoin/skywire", + "tags": "skywire", + "license-url": "" + } +}