-
Notifications
You must be signed in to change notification settings - Fork 0
/
i2p-zero.nsi
46 lines (39 loc) · 1.67 KB
/
i2p-zero.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
!define ZERONAME "I2P-Zero"
!define I2P64INSTDIR "$PROGRAMFILES64\I2P\"
!define I2P32INSTDIR "$PROGRAMFILES32\I2P\"
!define ZEROINSTDIR "$PROGRAMFILES64\${ZERONAME}\"
# Include the logic library for checking file exists.
!include LogicLib.nsh
function buildZero
!system "echo '#! /usr/bin/env sh' > build-docker.sh"
!system "echo 'docker rm -f i2p-zero-build' >> build-docker.sh"
!system "echo 'docker run -td --name i2p-zero-build --rm ubuntu' >> build-docker.sh"
!system "echo 'docker exec -ti i2p-zero-build bash -c ;' >> build-docker.sh"
!system "echo ' apt-get update && ' >> build-docker.sh"
!system "echo ' apt-get -y install git wget zip unzip && ' >> build-docker.sh"
!system "echo ' git clone https://github.com/i2p-zero/i2p-zero.git && ' >> build-docker.sh"
!system "echo ' cd i2p-zero && bash bin/build-all-and-zip.sh;' >> build-docker.sh"
!system "echo 'docker cp i2p-zero-build:/i2p-zero/dist-zip' ./ >> build-docker.sh"
!system "echo 'docker container stop i2p-zero-build' >> build-docker.sh"
!system "sed -i $\"s|;|'|g$\" build-docker.sh"
!system "chmod +x build-docker.sh"
!system ./build-docker.sh
!system "unzip dist-zip/i2p-zero-win-gui.*.zip"
!system "rm -rf I2P-Zero"
!system "mv i2p-zero-win-gui.* I2P-Zero"
functionEnd
function installZero
${If} ${FileExists} "${I2P64INSTDIR}\I2P.exe"
SetOutPath "${ZEROINSTDIR}"
${ElseIf} ${FileExists} "${I2P32INSTDIR}\I2P.exe"
SetOutPath "${ZEROINSTDIR}"
${Else}
SetOutPath "${ZEROINSTDIR}"
File /a /r "./I2P-Zero/"
CreateShortcut "$SMPROGRAMS\Run I2P-Zero.lnk" "${ZEROINSTDIR}\router\i2p-zero.exe"
${EndIf}
functionEnd
function un.installZero
Delete "$SMPROGRAMS\Run I2P-Zero.lnk"
RMDir $INSTDIR
functionEnd