-
Notifications
You must be signed in to change notification settings - Fork 0
/
FloatmotionInstaller_Testing.nsi
127 lines (91 loc) · 3.38 KB
/
FloatmotionInstaller_Testing.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
121
122
123
124
125
126
127
; bigtest.nsi
;
; This script attempts to test most of the functionality of the NSIS exehead.
;--------------------------------
!ifdef HAVE_UPX
!packhdr tmp.dat "upx\upx -9 tmp.dat"
!endif
!ifdef NOCOMPRESS
SetCompress off
!endif
;--------------------------------
Name "Floatmotion"
Caption "Floatmotion - Nico Bosshard"
#Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico"
Icon ".\img\Cube.ico"
OutFile "FloatmotionSetup.exe"
SetCompressor LZMA
SetDateSave on
SetDatablockOptimize on
CRCCheck on
SilentInstall normal
BGGradient 000000 800000 FFFFFF
InstallColors 80FF80 000030
XPStyle on
InstallDir "$PROGRAMFILES\Floatmotion"
InstallDirRegKey HKLM "Software\Floatmotion" "Install_Dir"
CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
LicenseText "Floatmotion is a free open source software from Nico Bosshard made for a school project"
LicenseData "LICENSE"
RequestExecutionLevel admin
Var SelectionWarning_OK
;--------------------------------
Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
!ifndef NOINSTTYPES ; only if not defined
InstType "Normal"
InstType "Full"
InstType "Base"
;InstType /NOCUSTOM
;InstType /COMPONENTSONLYONCUSTOM
!endif
AutoCloseWindow false
ShowInstDetails show
;--------------------------------
Section "Install Git Repository"
SectionIn 1 2
CreateDirectory "$INSTDIR\7-Zip"
SetOutPath "$INSTDIR\7-Zip"
File .\7-Zip\*
SetOutPath $INSTDIR
File ".\.git.7z"
ExecWait '"$INSTDIR\7-Zip\7z.exe" x "$INSTDIR\.git.7z" -y'
Delete "$INSTDIR\.git.7z"
Sleep 100 # Only to be on the sure side.
RMDir /r "$INSTDIR\7-Zip"
File /a ".\.gitattributes"
File /a ".\.gitignore"
SectionEnd
Section "" ; empty string makes it hidden, so would starting with -
SetOutPath $INSTDIR
WriteUninstaller "Uninstall.exe"
; write reg info
WriteRegStr HKLM SOFTWARE\Floatmotion "Install_Dir" "$INSTDIR"
; write uninstall strings
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Floatmotion" "DisplayName" "Floatmotion (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Floatmotion" "UninstallString" '"$INSTDIR\Uninstall.exe"'
SectionEnd
Function .onSelChange
StrCmp $SelectionWarning_OK "SelectionWarning_OK" +3 0
MessageBox MB_OK|MB_ICONEXCLAMATION "Warning: Some of the packets you see on this page are required for my program. Unchek the requires ones only if you 100% understand what you are doing and have this packages already installed manually. For normal Users: Don't use the manually package selection. I made this page only for Developers!"
StrCpy $SelectionWarning_OK "SelectionWarning_OK"
FunctionEnd
;--------------------------------
; Uninstaller
UninstallText "This will uninstall Floatmotion. Hit next to continue."
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico"
Section "Uninstall"
MessageBox MB_YESNO|MB_ICONQUESTION "Are you sure to completely uninstall Floatmotion from your computer?" IDNO NoDelete
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Floatmotion"
DeleteRegKey HKLM "SOFTWARE\Floatmotion"
RMDir /r "$INSTDIR"
IfFileExists "$INSTDIR" 0 NoErrorMsg
MessageBox MB_OK "Note: $INSTDIR could not be removed! Please delete it manually." IDOK 0 ; skipped if file doesn't exist
NoErrorMsg:
NoDelete:
SectionEnd