forked from paukr/auremo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuremoInstaller.nsi
62 lines (48 loc) · 1.93 KB
/
AuremoInstaller.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
; AuremoInstaller.nsi
;
; Based largely on the Example2.nsi script that ships with NSIS.
; To be improved later.
;
; To build the installer, copy Auremo.exe into the same direcory
; with this file and compile this file with the NSIS compiler.
;---------------------------------------------------------------
Name "AuremoInstaller"
OutFile "AuremoInstaller.exe"
InstallDir $PROGRAMFILES\Auremo
InstallDirRegKey HKLM "Software\Auremo" "Install_Dir"
RequestExecutionLeveL admin
;------------------------------
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;------------------------------
Section "Auremo"
SectionIn RO
SetOutPath $INSTDIR
File "Auremo.exe"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\Auremo "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Auremo" "DisplayName" "Auremo"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Auremo" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Auremo" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Auremo" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Auremo"
CreateShortCut "$SMPROGRAMS\Auremo\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Auremo\Auremo.lnk" "$INSTDIR\Auremo.exe" "" "$INSTDIR\Auremo.exe" 0
SectionEnd
Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Auremo"
DeleteRegKey HKLM SOFTWARE\Auremo
; Remove files
Delete $INSTDIR\Auremo.exe
Delete $INSTDIR\uninstall.exe
; Remove shortcuts
Delete "$SMPROGRAMS\Auremo\*.*"
RMDir "$SMPROGRAMS\Auremo"
RMDir "$INSTDIR"
SectionEnd