|
1 |
| -# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and |
2 |
| -# adds uninstall information to the registry for Add/Remove Programs |
3 |
| - |
4 |
| -# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - |
5 |
| -# You'll have to create these yourself) and run makensis on it |
6 |
| - |
7 |
| -# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they |
8 |
| -# show up in a few places. |
9 |
| -# All the other settings can be tweaked by editing the !defines at the top of this script |
10 |
| -# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed |
11 |
| -!define APPNAME "Minikube" |
12 |
| -!define COMPANYNAME "Kubernetes" |
13 |
| -!define DESCRIPTION "A Local Kubernetes Development Environment" |
14 |
| -# These three must be integers |
15 |
| -!define VERSIONMAJOR --VERSION_MAJOR-- |
16 |
| -!define VERSIONMINOR --VERSION_MINOR-- |
17 |
| -!define VERSIONBUILD --VERSION_BUILD-- |
18 |
| -# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" |
19 |
| -# It is possible to use "mailto:" links in here to open the email client |
20 |
| -!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link |
21 |
| -!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link |
22 |
| -!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link |
23 |
| -# This is the size (in kB) of all the files copied into "Program Files" |
24 |
| -!define INSTALLSIZE --INSTALL_SIZE-- |
25 |
| - |
26 |
| -RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) |
27 |
| - |
28 |
| -InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" |
29 |
| -!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" |
30 |
| -BrandingText " " |
31 |
| - |
32 |
| -# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) |
33 |
| -# This will be in the installer/uninstaller's title bar |
34 |
| -Name "${COMPANYNAME} - ${APPNAME}" |
35 |
| -Icon "logo.ico" |
36 |
| -OutFile "minikube-installer.exe" |
37 |
| - |
38 |
| -!include "LogicLib.nsh" |
39 |
| -!include "MUI2.nsh" ; Modern UI |
40 |
| - |
41 |
| -!define MUI_ICON "logo.ico" |
42 |
| -!define MUI_UNICON "logo.ico" |
43 |
| -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" |
44 |
| -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" |
45 |
| -!define MUI_HEADERIMAGE_BITMAP "logo.bmp" |
46 |
| -!define MUI_FINISHPAGE_NOAUTOCLOSE |
47 |
| -!define MUI_UNFINISHPAGE_NOAUTOCLOSE |
48 |
| - |
49 |
| -!insertmacro MUI_PAGE_WELCOME |
50 |
| -!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" |
51 |
| -!insertmacro MUI_PAGE_DIRECTORY |
52 |
| -!insertmacro MUI_PAGE_INSTFILES |
53 |
| -!insertmacro MUI_PAGE_FINISH |
54 |
| - |
55 |
| -!insertmacro MUI_UNPAGE_WELCOME |
56 |
| -!insertmacro MUI_UNPAGE_CONFIRM |
57 |
| -!insertmacro MUI_UNPAGE_INSTFILES |
58 |
| -!insertmacro MUI_UNPAGE_FINISH |
59 |
| - |
60 |
| -; Set languages (first is default language) |
61 |
| -;!insertmacro MUI_LANGUAGE "English" |
62 |
| -!define MUI_LANGDLL_ALLLANGUAGES |
63 |
| -;Languages |
64 |
| - |
65 |
| - !insertmacro MUI_LANGUAGE "English" |
66 |
| - !insertmacro MUI_LANGUAGE "French" |
67 |
| - !insertmacro MUI_LANGUAGE "TradChinese" |
68 |
| - !insertmacro MUI_LANGUAGE "Spanish" |
69 |
| - !insertmacro MUI_LANGUAGE "Hungarian" |
70 |
| - !insertmacro MUI_LANGUAGE "Russian" |
71 |
| - !insertmacro MUI_LANGUAGE "German" |
72 |
| - !insertmacro MUI_LANGUAGE "Dutch" |
73 |
| - !insertmacro MUI_LANGUAGE "SimpChinese" |
74 |
| - !insertmacro MUI_LANGUAGE "Italian" |
75 |
| - !insertmacro MUI_LANGUAGE "Danish" |
76 |
| - !insertmacro MUI_LANGUAGE "Polish" |
77 |
| - !insertmacro MUI_LANGUAGE "Czech" |
78 |
| - !insertmacro MUI_LANGUAGE "Slovenian" |
79 |
| - !insertmacro MUI_LANGUAGE "Slovak" |
80 |
| - !insertmacro MUI_LANGUAGE "Swedish" |
81 |
| - !insertmacro MUI_LANGUAGE "Norwegian" |
82 |
| - !insertmacro MUI_LANGUAGE "PortugueseBR" |
83 |
| - !insertmacro MUI_LANGUAGE "Ukrainian" |
84 |
| - !insertmacro MUI_LANGUAGE "Turkish" |
85 |
| - !insertmacro MUI_LANGUAGE "Catalan" |
86 |
| - !insertmacro MUI_LANGUAGE "Arabic" |
87 |
| - !insertmacro MUI_LANGUAGE "Lithuanian" |
88 |
| - !insertmacro MUI_LANGUAGE "Finnish" |
89 |
| - !insertmacro MUI_LANGUAGE "Greek" |
90 |
| - !insertmacro MUI_LANGUAGE "Korean" |
91 |
| - !insertmacro MUI_LANGUAGE "Hebrew" |
92 |
| - !insertmacro MUI_LANGUAGE "Portuguese" |
93 |
| - !insertmacro MUI_LANGUAGE "Farsi" |
94 |
| - !insertmacro MUI_LANGUAGE "Bulgarian" |
95 |
| - !insertmacro MUI_LANGUAGE "Indonesian" |
96 |
| - !insertmacro MUI_LANGUAGE "Japanese" |
97 |
| - !insertmacro MUI_LANGUAGE "Croatian" |
98 |
| - !insertmacro MUI_LANGUAGE "Serbian" |
99 |
| - !insertmacro MUI_LANGUAGE "Thai" |
100 |
| - !insertmacro MUI_LANGUAGE "NorwegianNynorsk" |
101 |
| - !insertmacro MUI_LANGUAGE "Belarusian" |
102 |
| - !insertmacro MUI_LANGUAGE "Albanian" |
103 |
| - !insertmacro MUI_LANGUAGE "Malay" |
104 |
| - !insertmacro MUI_LANGUAGE "Galician" |
105 |
| - !insertmacro MUI_LANGUAGE "Basque" |
106 |
| - !insertmacro MUI_LANGUAGE "Luxembourgish" |
107 |
| - !insertmacro MUI_LANGUAGE "Afrikaans" |
108 |
| - !insertmacro MUI_LANGUAGE "Uzbek" |
109 |
| - !insertmacro MUI_LANGUAGE "Macedonian" |
110 |
| - !insertmacro MUI_LANGUAGE "Latvian" |
111 |
| - !insertmacro MUI_LANGUAGE "Bosnian" |
112 |
| - !insertmacro MUI_LANGUAGE "Mongolian" |
113 |
| - !insertmacro MUI_LANGUAGE "Estonian" |
114 |
| - |
115 |
| -!insertmacro MUI_RESERVEFILE_LANGDLL |
116 |
| - |
117 |
| -Function .onInit |
118 |
| - |
119 |
| - !insertmacro MUI_LANGDLL_DISPLAY |
120 |
| - |
121 |
| -FunctionEnd |
122 |
| - |
123 |
| -Section "Install" |
124 |
| - # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) |
125 |
| - SetOutPath $INSTDIR |
126 |
| - # Files added here should be removed by the uninstaller (see section "uninstall") |
127 |
| - File "minikube.exe" |
128 |
| - File "logo.ico" |
129 |
| - File "update_path.ps1" |
130 |
| - # Add any other files for the install directory (license files, app data, etc) here |
131 |
| - |
132 |
| - # Uninstaller - See function un.onInit and section "uninstall" for configuration |
133 |
| - WriteUninstaller "$INSTDIR\uninstall.exe" |
134 |
| - |
135 |
| - # Start Menu |
136 |
| - CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" |
137 |
| - CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" |
138 |
| - |
139 |
| - # Registry information for add/remove programs |
140 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" |
141 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" |
142 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" |
143 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" |
144 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" |
145 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" |
146 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" |
147 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" |
148 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" |
149 |
| - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" |
150 |
| - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} |
151 |
| - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} |
152 |
| - |
153 |
| - # There is no option for modifying or repairing the install |
154 |
| - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 |
155 |
| - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 |
156 |
| - |
157 |
| - # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size |
158 |
| - WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} |
159 |
| - |
160 |
| - # Add installed executable to PATH |
161 |
| - # Cannot uset EnvVarUpdate since the path can be too long |
162 |
| - # this is explicitly warned in the documentation page |
163 |
| - # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries |
164 |
| - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' |
165 |
| - |
166 |
| -SectionEnd |
167 |
| - |
168 |
| -Section "Uninstall" |
169 |
| - |
170 |
| - # Remove Start Menu launcher |
171 |
| - Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" |
172 |
| - # Try to remove the Start Menu folder - this will only happen if it is empty |
173 |
| - RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" |
174 |
| - |
175 |
| - # Remove uninstalled executable from PATH |
176 |
| - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; Removes minikube from System Path |
177 |
| - |
178 |
| - # Remove files |
179 |
| - Delete /REBOOTOK $INSTDIR\minikube.exe |
180 |
| - Delete /REBOOTOK $INSTDIR\logo.ico |
181 |
| - Delete /REBOOTOK $INSTDIR\update_path.ps1 |
182 |
| - |
183 |
| - # Always delete uninstaller as the last action |
184 |
| - Delete /REBOOTOK $INSTDIR\uninstall.exe |
185 |
| - |
186 |
| - # Try to remove the install directory - this will only happen if it is empty |
187 |
| - RmDir /REBOOTOK $INSTDIR |
188 |
| - |
189 |
| - # Remove uninstaller information from the registry |
190 |
| - DeleteRegKey HKLM "${UNINSTALLDIR}" |
191 |
| - |
192 |
| -SectionEnd |
| 1 | +# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and |
| 2 | +# adds uninstall information to the registry for Add/Remove Programs |
| 3 | + |
| 4 | +# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - |
| 5 | +# You'll have to create these yourself) and run makensis on it |
| 6 | + |
| 7 | +# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they |
| 8 | +# show up in a few places. |
| 9 | +# All the other settings can be tweaked by editing the !defines at the top of this script |
| 10 | +# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed |
| 11 | +!define APPNAME "Minikube" |
| 12 | +!define COMPANYNAME "Kubernetes" |
| 13 | +!define DESCRIPTION "A Local Kubernetes Development Environment" |
| 14 | +# These three must be integers |
| 15 | +!define VERSIONMAJOR --VERSION_MAJOR-- |
| 16 | +!define VERSIONMINOR --VERSION_MINOR-- |
| 17 | +!define VERSIONBUILD --VERSION_BUILD-- |
| 18 | +# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" |
| 19 | +# It is possible to use "mailto:" links in here to open the email client |
| 20 | +!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link |
| 21 | +!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link |
| 22 | +!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link |
| 23 | +# This is the size (in kB) of all the files copied into "Program Files" |
| 24 | +!define INSTALLSIZE --INSTALL_SIZE-- |
| 25 | + |
| 26 | +RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) |
| 27 | + |
| 28 | +InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" |
| 29 | +!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" |
| 30 | +BrandingText " " |
| 31 | + |
| 32 | +# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) |
| 33 | +# This will be in the installer/uninstaller's title bar |
| 34 | +Name "${COMPANYNAME} - ${APPNAME}" |
| 35 | +Icon "logo.ico" |
| 36 | +OutFile "minikube-installer.exe" |
| 37 | + |
| 38 | +!include "LogicLib.nsh" |
| 39 | +!include "MUI2.nsh" ; Modern UI |
| 40 | + |
| 41 | +!define MUI_ICON "logo.ico" |
| 42 | +!define MUI_UNICON "logo.ico" |
| 43 | +!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" |
| 44 | +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" |
| 45 | +!define MUI_HEADERIMAGE_BITMAP "logo.bmp" |
| 46 | +!define MUI_FINISHPAGE_NOAUTOCLOSE |
| 47 | +!define MUI_UNFINISHPAGE_NOAUTOCLOSE |
| 48 | + |
| 49 | +!insertmacro MUI_PAGE_WELCOME |
| 50 | +!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" |
| 51 | +!insertmacro MUI_PAGE_DIRECTORY |
| 52 | +!insertmacro MUI_PAGE_INSTFILES |
| 53 | +!insertmacro MUI_PAGE_FINISH |
| 54 | + |
| 55 | +!insertmacro MUI_UNPAGE_WELCOME |
| 56 | +!insertmacro MUI_UNPAGE_CONFIRM |
| 57 | +!insertmacro MUI_UNPAGE_INSTFILES |
| 58 | +!insertmacro MUI_UNPAGE_FINISH |
| 59 | + |
| 60 | +; Set languages (first is default language) |
| 61 | +;!insertmacro MUI_LANGUAGE "English" |
| 62 | +!define MUI_LANGDLL_ALLLANGUAGES |
| 63 | +;Languages |
| 64 | + |
| 65 | + !insertmacro MUI_LANGUAGE "English" |
| 66 | + !insertmacro MUI_LANGUAGE "French" |
| 67 | + !insertmacro MUI_LANGUAGE "TradChinese" |
| 68 | + !insertmacro MUI_LANGUAGE "Spanish" |
| 69 | + !insertmacro MUI_LANGUAGE "Hungarian" |
| 70 | + !insertmacro MUI_LANGUAGE "Russian" |
| 71 | + !insertmacro MUI_LANGUAGE "German" |
| 72 | + !insertmacro MUI_LANGUAGE "Dutch" |
| 73 | + !insertmacro MUI_LANGUAGE "SimpChinese" |
| 74 | + !insertmacro MUI_LANGUAGE "Italian" |
| 75 | + !insertmacro MUI_LANGUAGE "Danish" |
| 76 | + !insertmacro MUI_LANGUAGE "Polish" |
| 77 | + !insertmacro MUI_LANGUAGE "Czech" |
| 78 | + !insertmacro MUI_LANGUAGE "Slovenian" |
| 79 | + !insertmacro MUI_LANGUAGE "Slovak" |
| 80 | + !insertmacro MUI_LANGUAGE "Swedish" |
| 81 | + !insertmacro MUI_LANGUAGE "Norwegian" |
| 82 | + !insertmacro MUI_LANGUAGE "PortugueseBR" |
| 83 | + !insertmacro MUI_LANGUAGE "Ukrainian" |
| 84 | + !insertmacro MUI_LANGUAGE "Turkish" |
| 85 | + !insertmacro MUI_LANGUAGE "Catalan" |
| 86 | + !insertmacro MUI_LANGUAGE "Arabic" |
| 87 | + !insertmacro MUI_LANGUAGE "Lithuanian" |
| 88 | + !insertmacro MUI_LANGUAGE "Finnish" |
| 89 | + !insertmacro MUI_LANGUAGE "Greek" |
| 90 | + !insertmacro MUI_LANGUAGE "Korean" |
| 91 | + !insertmacro MUI_LANGUAGE "Hebrew" |
| 92 | + !insertmacro MUI_LANGUAGE "Portuguese" |
| 93 | + !insertmacro MUI_LANGUAGE "Farsi" |
| 94 | + !insertmacro MUI_LANGUAGE "Bulgarian" |
| 95 | + !insertmacro MUI_LANGUAGE "Indonesian" |
| 96 | + !insertmacro MUI_LANGUAGE "Japanese" |
| 97 | + !insertmacro MUI_LANGUAGE "Croatian" |
| 98 | + !insertmacro MUI_LANGUAGE "Serbian" |
| 99 | + !insertmacro MUI_LANGUAGE "Thai" |
| 100 | + !insertmacro MUI_LANGUAGE "NorwegianNynorsk" |
| 101 | + !insertmacro MUI_LANGUAGE "Belarusian" |
| 102 | + !insertmacro MUI_LANGUAGE "Albanian" |
| 103 | + !insertmacro MUI_LANGUAGE "Malay" |
| 104 | + !insertmacro MUI_LANGUAGE "Galician" |
| 105 | + !insertmacro MUI_LANGUAGE "Basque" |
| 106 | + !insertmacro MUI_LANGUAGE "Luxembourgish" |
| 107 | + !insertmacro MUI_LANGUAGE "Afrikaans" |
| 108 | + !insertmacro MUI_LANGUAGE "Uzbek" |
| 109 | + !insertmacro MUI_LANGUAGE "Macedonian" |
| 110 | + !insertmacro MUI_LANGUAGE "Latvian" |
| 111 | + !insertmacro MUI_LANGUAGE "Bosnian" |
| 112 | + !insertmacro MUI_LANGUAGE "Mongolian" |
| 113 | + !insertmacro MUI_LANGUAGE "Estonian" |
| 114 | + |
| 115 | +!insertmacro MUI_RESERVEFILE_LANGDLL |
| 116 | + |
| 117 | +Function .onInit |
| 118 | + |
| 119 | + !insertmacro MUI_LANGDLL_DISPLAY |
| 120 | + |
| 121 | +FunctionEnd |
| 122 | + |
| 123 | +Section "Install" |
| 124 | + # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) |
| 125 | + SetOutPath $INSTDIR |
| 126 | + # Files added here should be removed by the uninstaller (see section "uninstall") |
| 127 | + File "minikube.exe" |
| 128 | + File "logo.ico" |
| 129 | + File "update_path.ps1" |
| 130 | + # Add any other files for the install directory (license files, app data, etc) here |
| 131 | + |
| 132 | + # Uninstaller - See function un.onInit and section "uninstall" for configuration |
| 133 | + WriteUninstaller "$INSTDIR\uninstall.exe" |
| 134 | + |
| 135 | + # Start Menu |
| 136 | + CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" |
| 137 | + CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" |
| 138 | + |
| 139 | + # Registry information for add/remove programs |
| 140 | + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" |
| 141 | + WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" |
| 142 | + WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" |
| 143 | + WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" |
| 144 | + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" |
| 145 | + WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" |
| 146 | + WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" |
| 147 | + WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" |
| 148 | + WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" |
| 149 | + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" |
| 150 | + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} |
| 151 | + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} |
| 152 | + |
| 153 | + # There is no option for modifying or repairing the install |
| 154 | + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 |
| 155 | + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 |
| 156 | + |
| 157 | + # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size |
| 158 | + WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} |
| 159 | + |
| 160 | + # Add installed executable to PATH |
| 161 | + # Cannot uset EnvVarUpdate since the path can be too long |
| 162 | + # this is explicitly warned in the documentation page |
| 163 | + # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries |
| 164 | + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' |
| 165 | + |
| 166 | +SectionEnd |
| 167 | + |
| 168 | +Section "Uninstall" |
| 169 | + |
| 170 | + # Remove Start Menu launcher |
| 171 | + Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" |
| 172 | + # Try to remove the Start Menu folder - this will only happen if it is empty |
| 173 | + RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" |
| 174 | + |
| 175 | + # Remove uninstalled executable from PATH |
| 176 | + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; Removes minikube from System Path |
| 177 | + |
| 178 | + # Remove files |
| 179 | + Delete /REBOOTOK $INSTDIR\minikube.exe |
| 180 | + Delete /REBOOTOK $INSTDIR\logo.ico |
| 181 | + Delete /REBOOTOK $INSTDIR\update_path.ps1 |
| 182 | + |
| 183 | + # Always delete uninstaller as the last action |
| 184 | + Delete /REBOOTOK $INSTDIR\uninstall.exe |
| 185 | + |
| 186 | + # Try to remove the install directory - this will only happen if it is empty |
| 187 | + RmDir /REBOOTOK $INSTDIR |
| 188 | + |
| 189 | + # Remove uninstaller information from the registry |
| 190 | + DeleteRegKey HKLM "${UNINSTALLDIR}" |
| 191 | + |
| 192 | +SectionEnd |
0 commit comments