diff --git a/msi-builder/BuildFinchMSI.ps1 b/msi-builder/BuildFinchMSI.ps1 index 7e3bb52b3..fce453af0 100644 --- a/msi-builder/BuildFinchMSI.ps1 +++ b/msi-builder/BuildFinchMSI.ps1 @@ -60,6 +60,7 @@ Write-Host "Files copied successfully." Write-Host "4. Copy extra scripts, license and icon..." Copy-Item -Path (Join-Path -Path $scriptDirectory -ChildPath "postinstall.bat") -Destination (Join-Path -Path $scriptDirectory -ChildPath "build\Finch") Copy-Item -Path (Join-Path -Path $scriptDirectory -ChildPath "uninstall.bat") -Destination (Join-Path -Path $scriptDirectory -ChildPath "build\Finch") +Copy-Item -Path (Join-Path -Path $scriptDirectory -ChildPath "removevm.bat") -Destination (Join-Path -Path $scriptDirectory -ChildPath "build\Finch") Copy-Item -Path (Join-Path -Path $scriptDirectory -ChildPath "finch.ico") -Destination (Join-Path -Path $scriptDirectory -ChildPath "build\Finch") Copy-Item -Path (Join-Path -Path $scriptDirectory -ChildPath "LICENSE.rtf") -Destination (Join-Path -Path $scriptDirectory -ChildPath "build\Finch") Write-Host "Files copied successfully." diff --git a/msi-builder/FinchMSITemplate.wxs b/msi-builder/FinchMSITemplate.wxs index eb36a4acd..aa1823d17 100644 --- a/msi-builder/FinchMSITemplate.wxs +++ b/msi-builder/FinchMSITemplate.wxs @@ -21,6 +21,7 @@ + @@ -102,9 +103,11 @@ + - NOT Installed + NOT Installed + NOT Installed REMOVE="ALL" diff --git a/msi-builder/removevm.bat b/msi-builder/removevm.bat new file mode 100644 index 000000000..9d595ffbb --- /dev/null +++ b/msi-builder/removevm.bat @@ -0,0 +1,10 @@ +@echo off +SET InstallDir=%~1 + +:: Stop and remove any running instance +finch.exe vm stop -f ^ & +finch.exe vm remove -f ^ & + +:: Just in case +wsl --terminate lima-finch ^ & +wsl --unregister lima-finch