-
Notifications
You must be signed in to change notification settings - Fork 0
/
win-x64.nsi
65 lines (44 loc) · 2.08 KB
/
win-x64.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
Name "Tetrominoes.OpenGL"
OutFile "Tetrominoes-OpenGL-win-x64.exe"
InstallDir '$PROGRAMFILES64\JonCloud Studios\Tetrominoes\'
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
; InstallDirRegKey HKLM "Software\NSIS_Example2" "Install_Dir"
RequestExecutionLevel admin
;--------------------------------
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
Section "Game"
SectionIn RO
SetOutPath $INSTDIR
File /r "src\Tetrominoes.OpenGL\bin\Release\netcoreapp3.1\win-x64\publish\*.*"
; Write the installation path into the registry
; WriteRegStr HKLM SOFTWARE\NSIS_Example2 "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tetrominoes.OpenGL" "DisplayName" "Tetrominoes.OpenGL"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tetrominoes.OpenGL" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tetrominoes.OpenGL" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tetrominoes.OpenGL" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Tetrominoes.OpenGL"
CreateShortcut "$SMPROGRAMS\Tetrominoes.OpenGL\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortcut "$SMPROGRAMS\Tetrominoes.OpenGL\Tetrominoes.OpenGL.lnk" "$INSTDIR\Tetrominoes.OpenGL.exe" "" "$INSTDIR\Tetrominoes.OpenGL.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tetrominoes.OpenGL"
;DeleteRegKey HKLM SOFTWARE\NSIS_Example2
Delete "$INSTDIR\*.*"
Delete "$SMPROGRAMS\Tetrominoes.OpenGL\*.*"
RMDir "$SMPROGRAMS\Tetrominoes.OpenGL"
RMDir "$INSTDIR"
SectionEnd