@@ -222,6 +222,7 @@ function downloadIso() {
222
222
if ( -not (Test-Path " $iso_path " ) ) {
223
223
$ciso = " Z:\Downloads\$iso_file "
224
224
if ( Test-Path " $ciso " ) {
225
+ echo ' Cached.'
225
226
copy " $ciso " " $iso_path "
226
227
} else {
227
228
try {
@@ -1154,6 +1155,26 @@ function hideConsole() {
1154
1155
[Console.Window ]::ShowWindow($consoleWin , 6 )
1155
1156
}
1156
1157
1158
+ function uninstall () {
1159
+ if ( ! ([Security.Principal.WindowsPrincipal ] `
1160
+ [Security.Principal.WindowsIdentity ]::GetCurrent() `
1161
+ ).IsInRole([Security.Principal.WindowsBuiltInRole ]::Administrator) ) {
1162
+ echo ' Must be an Administrator'
1163
+ exit 1
1164
+ }
1165
+ if ( test-path (" ${ global:tunic_dir } \bcd.id" ) ) {
1166
+ $osloader = (get-content " ${ global:tunic_dir } \bcd.id" )
1167
+ bcdedit / delete " $osloader " / cleanup / f
1168
+ }
1169
+ $efi = " S:"
1170
+ if ( -not (Test-Path " $efi " ) ) {
1171
+ mountvol $efi / s
1172
+ }
1173
+ rm " ${efi} \boot" - recurse - force
1174
+ mountvol " $efi " / d
1175
+ rm " ${ global:tunic_dir } " - recurse - force
1176
+ }
1177
+
1157
1178
# Installs full disk install.
1158
1179
# Mainly for testing purposes.
1159
1180
# User will have 'tunic' password.
@@ -1163,8 +1184,9 @@ function fullDisk() {
1163
1184
$global :data.password = ' tunic'
1164
1185
# copied from distros.ps1
1165
1186
$url = ' http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso'
1166
- $url = ' http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-xfce-64bit.iso'
1167
1187
$url = ' http://releases.ubuntu.com/19.10/ubuntu-19.10-desktop-amd64.iso'
1188
+ $url = ' http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-xfce-64bit.iso'
1189
+ $url = ' http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-cinnamon-64bit.iso'
1168
1190
$global :data.iso_url = $url
1169
1191
1170
1192
if ( $global :data.installType -eq $DUALBOOT ) {
@@ -1218,6 +1240,9 @@ switch($op) {
1218
1240
$global :form = (gui)
1219
1241
[void ]$form.showDialog ()
1220
1242
}
1243
+ {$_ -eq " uninstall" } {
1244
+ uninstall
1245
+ }
1221
1246
default {
1222
1247
$global :form = (gui)
1223
1248
[void ]$form.showDialog ()
0 commit comments