-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add uninstaller
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,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 |