-
Notifications
You must be signed in to change notification settings - Fork 55
/
pt.nsi
120 lines (85 loc) · 3.71 KB
/
pt.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
!include "MUI.nsh"
!define MUI_FINISHPAGE_RUN "$INSTDIR\ProcrastiTracker.exe"
!define MUI_HEADERIMAGE
/*
!define MUI_HEADERIMAGE_BITMAP "procrastitracker\dot3inst.bmp"
*/
/*
doesn't show?
!define MUI_HEADERIMAGE_UNBITMAP "procrastitracker\dot3inst.bmp"
*/
Name "ProcrastiTracker"
OutFile "ProcrastiTracker_Setup.exe"
XPStyle on
InstallDir $PROGRAMFILES\ProcrastiTracker
InstallDirRegKey HKLM "Software\ProcrastiTracker" "Install_Dir"
SetCompressor /SOLID lzma
XPStyle on
Page components #"" ba ""
Page directory
Page instfiles
!insertmacro MUI_PAGE_FINISH
UninstPage uninstConfirm
UninstPage instfiles
!insertmacro MUI_LANGUAGE "English"
/*
AddBrandingImage top 65
Function ba
File procrastitracker\dot3.bmp
SetBrandingImage procrastitracker\dot3.bmp
FunctionEnd
Function un.ba
SetBrandingImage procrastitracker\dot3.bmp
FunctionEnd
*/
Function .onInit
FindWindow $0 "PROCRASTITRACKER" ""
StrCmp $0 0 continueInstall
MessageBox MB_ICONSTOP|MB_OK "Procrastitracker is already running, please close it and try again."
Abort
continueInstall:
FunctionEnd
Function un.onInit
FindWindow $0 "PROCRASTITRACKER" ""
StrCmp $0 0 continueInstall
MessageBox MB_ICONSTOP|MB_OK "Procrastitracker is still running, please close it and try again."
Abort
continueInstall:
FunctionEnd
Section "ProcrastiTracker (required)"
SectionIn RO
SetOutPath $INSTDIR
File /r "PT\*.*"
WriteRegStr HKLM SOFTWARE\ProcrastiTracker "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "DisplayName" "ProcrastiTracker"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "Publisher" "Wouter van Oortmerssen"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "DisplayIcon" "$\"$INSTDIR\procrastitracker.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "InstallLocation" "$INSTDIR"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
/*
Section "Visual C++ redistributable runtime"
ExecWait '"$INSTDIR\redist\vcredist_x86.exe"'
SectionEnd
*/
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\ProcrastiTracker"
CreateDirectory "$APPDATA\procrastitrackerdbs\"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\ProcrastiTracker\ProcrastiTracker.lnk" "$INSTDIR\ProcrastiTracker.exe" "" "$INSTDIR\ProcrastiTracker.exe" 0
CreateShortCut "$SMPROGRAMS\ProcrastiTracker\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\ProcrastiTracker\README.lnk" "$INSTDIR\README.html" "" "$INSTDIR\README.html" 0
CreateShortCut "$SMPROGRAMS\ProcrastiTracker\Database Files.lnk" "$APPDATA\procrastitrackerdbs\" "" "$APPDATA\procrastitrackerdbs\" 0
CreateShortCut "$SMSTARTUP\ProcrastiTracker.lnk" "$INSTDIR\ProcrastiTracker.exe" "" "$INSTDIR\ProcrastiTracker.exe" 0
SectionEnd
Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ProcrastiTracker"
DeleteRegKey HKLM SOFTWARE\ProcrastiTracker
RMDir /r "$SMPROGRAMS\ProcrastiTracker"
Delete "$SMSTARTUP\ProcrastiTracker.lnk"
RMDir /r "$INSTDIR"
SectionEnd