Skip to content

Commit

Permalink
Merge pull request #1060 from the-skycoin-project/windows-installer
Browse files Browse the repository at this point in the history
Windows installer
  • Loading branch information
jdknives authored Jan 31, 2022
2 parents ed3633e + e264ec5 commit 3dd2dc5
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ Char
*.dmg
/scripts/mac_installer/icon.iconset/
releaseChangelog.md
skywire.msi
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'

Expand Down
2 changes: 0 additions & 2 deletions _apps/skychat

This file was deleted.

2 changes: 0 additions & 2 deletions _apps/skysocks

This file was deleted.

2 changes: 0 additions & 2 deletions _apps/skysocks-client

This file was deleted.

2 changes: 0 additions & 2 deletions _apps/vpn-client

This file was deleted.

2 changes: 0 additions & 2 deletions _apps/vpn-server

This file was deleted.

32 changes: 32 additions & 0 deletions scripts/win_installer/README.md
Original file line number Diff line number Diff line change
@@ -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.
Binary file added scripts/win_installer/ico.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions scripts/win_installer/script.ps1
Original file line number Diff line number Diff line change
@@ -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!"
12 changes: 12 additions & 0 deletions scripts/win_installer/skywire.bat
Original file line number Diff line number Diff line change
@@ -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"
47 changes: 47 additions & 0 deletions scripts/win_installer/wix.json
Original file line number Diff line number Diff line change
@@ -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": ""
}
}

0 comments on commit 3dd2dc5

Please sign in to comment.