Skip to content

Commit

Permalink
open-shell-np: Fixed pre_uninstall script so it only works when the…
Browse files Browse the repository at this point in the history
… user types `uninstall`. (#189)

* open-shell-np: Fix `pre_uninstall` script so it only works when the user types `uninstall`.

* Update open-shell-np.json

* Update open-shell-np.json
  • Loading branch information
FlawlessCasual17 committed Jun 16, 2023
1 parent 3bfaf0c commit 4dd1a76
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions bucket/open-shell-np.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@
]
},
"pre_uninstall": [
"if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
"Write-Host \"Restoring previous Start Menu, please wait and don't cancel the script...\" -F 'Yellow'",
"Stop-Process -Name 'StartMenu' -Force -ErrorAction 'SilentlyContinue'",
"Start-Sleep -Milliseconds 1000",
"Start-Process 'msiexec' -Verb 'RunAs' -ArgumentList @('/x', \"$dir\\setup.msi\", '/qn')",
"for ($i = 0; $i -lt 60; $i++) {",
" if (-Not (Test-Path \"$env:ProgramFiles\\Open-Shell\")) {",
" break",
" }",
" Start-Sleep -Milliseconds 1000",
"}",
"Start-Process 'taskkill' -Verb 'RunAs' -WindowStyle 'Hidden' -ArgumentList ('/F', '/IM', 'explorer.exe')",
"Start-Sleep -Milliseconds 5000",
"Start-Process 'explorer.exe' -Verb 'RunAs' -WindowStyle 'Hidden'",
"Write-Host 'Previous Start Menu Restored!' -F 'Yellow'"
"if ($cmd -eq 'uninstall') {",
" if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
" Write-Host \"Restoring previous Start Menu, please wait and don't cancel the script...\" -F 'Yellow'",
" Stop-Process -Name 'StartMenu' -Force -ErrorAction 'SilentlyContinue'",
" Start-Sleep -Milliseconds 1000",
" Start-Process 'msiexec' -Verb 'RunAs' -ArgumentList @('/x', \"$dir\\setup.msi\", '/qn')",
" for ($i = 0; $i -lt 60; $i++) {",
" if ((-Not (Test-Path \"$env:ProgramFiles\\Open-Shell\")) -or (-Not (Test-Path \"${env:ProgramFiles(x86)}\\Open-Shell\"))) {",
" break",
" }",
" Start-Sleep -Milliseconds 1000",
" }",
" Start-Process 'taskkill' -Verb 'RunAs' -WindowStyle 'Hidden' -ArgumentList ('/F', '/IM', 'explorer.exe')",
" Start-Sleep -Milliseconds 5000",
" Start-Process 'explorer.exe' -Verb 'RunAs' -WindowStyle 'Hidden'",
" Write-Host 'Previous Start Menu Restored!' -F 'Yellow'",
"}"
],
"checkver": "github",
"autoupdate": {
Expand Down

0 comments on commit 4dd1a76

Please sign in to comment.