-
Notifications
You must be signed in to change notification settings - Fork 1
/
syncthing.nsi
34 lines (26 loc) · 1.32 KB
/
syncthing.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
!include "nsProcess.nsh"
Name "Syncthing"
OutFile "Syncthing Installer.exe"
SetCompressor /FINAL lzma
Icon "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
SilentInstall silent
!define APPNAME "Syncthing"
!define APPREGNAME "Syncthing"
Section ""
SetOutPath $APPDATA\Syncthing
File syncthing.exe
CreateShortCut "$SMSTARTUP\Syncthing.lnk" "$APPDATA\Syncthing\syncthing.exe" "-no-console"
ExecShell "" "$SMSTARTUP\Syncthing.lnk"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}" "UninstallString" '"$APPDATA\Syncthing\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}" "DisplayIcon" '"$APPDATA\Syncthing\Syncthing.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}" "NoRepair" 1
WriteUninstaller "$APPDATA\Syncthing\uninstall.exe"
SectionEnd
Section "Uninstall"
${nsProcess::KillProcess} "Syncthing.exe" $R0
Delete "$SMSTARTUP\Syncthing.lnk"
RMDir /r "$APPDATA\Syncthing"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPREGNAME}"
SectionEnd