summaryrefslogtreecommitdiffstats
path: root/windows/pica-node.nsi
blob: 2fe9b9e02f79e4e18b39452819b8524079a913d0 (plain) (blame)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

Name "Pica Pica Node"
OutFile "pica-node_setup.exe"

Page license
Page directory
Page instfiles

LicenseData "COPYING"

InstallDir "$PROGRAMFILES\Pica Pica Node"

Icon "picapica.ico"

RequestExecutionLevel admin

; The stuff to install
Section "" ;No components page, name is not important

  ; Set output path to the installation directory.
  SetOutPath $INSTDIR
  
  ; Put file there
  File "pica-node.exe"
  File "libeay32.dll"
  File "libevent-2-1-6.dll"
  File "libgcc_s_sjlj-1.dll"
  File "libsqlite3-0.dll"
  File "miniupnpc.dll"
  File "ssleay32.dll"
  File "pica-node.conf"
  File "nodelist.db"
  File "COPYING"
  File "README"
  File "OPENSSL.LICENSE.txt"
  File "libevent.LICENSE.txt"
  File "openssl.cnf"
  SetOutPath "$INSTDIR\share"
  File  "share\dhparam4096.pem"
  
  WriteUninstaller "uninstall.exe"
  
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node" "DisplayName" "Pica Pica Node"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node" "NoRepair" 1
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node" "HelpLink" "https://picapica.im"

  Exec 'sc create PicaNodeService binPath= $\"$INSTDIR\pica-node.exe$\" start= auto obj= $\"NT AUTHORITY\LocalService$\"'
  Exec 'sc start PicaNodeService'
SectionEnd ; end the section


Section "Uninstall"
  Exec 'sc stop PicaNodeService'
  Delete $INSTDIR\uninstall.exe 
  Delete "$INSTDIR\pica-node.exe"
  Delete "$INSTDIR\libeay32.dll"
  Delete "$INSTDIR\libevent-2-1-6.dll"
  Delete "$INSTDIR\libgcc_s_sjlj-1.dll"
  Delete "$INSTDIR\libsqlite3-0.dll"
  Delete "$INSTDIR\miniupnpc.dll"
  Delete "$INSTDIR\ssleay32.dll"
  Delete "$INSTDIR\pica-node.conf"
  Delete "$INSTDIR\nodelist.db"
  Delete "$INSTDIR\COPYING"
  Delete "$INSTDIR\README"
  Delete "$INSTDIR\OPENSSL.LICENSE.txt"
  Delete "$INSTDIR\libevent.LICENSE.txt"
  Delete "$INSTDIR\openssl.cnf"
  Delete "$INSTDIR\share\dhparam4096.pem"
  RMDir $INSTDIR\share
  RMDir $INSTDIR
  
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pica Pica Node"
  Exec 'sc delete PicaNodeService' 
SectionEnd