diff options
| author | OpportunityLiu <[email protected]> | 2019-06-20 12:22:41 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-20 12:22:41 +0800 |
| commit | a3229f788ef9b0b1695e5996fc682ac4d0ab016a (patch) | |
| tree | be21a7459b01780bbbb228f1f9816cba3d183331 /scripts/get.ps1 | |
| parent | f36cd220cbf087247254b1f6700dd89c6b62428a (diff) | |
noamin
Diffstat (limited to 'scripts/get.ps1')
| -rw-r--r-- | scripts/get.ps1 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/get.ps1 b/scripts/get.ps1 index 21646bc7d..27b131d18 100644 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -102,7 +102,15 @@ function xmakeInstall { Write-Host 'Start installation... Hope your antivirus doesn''t trouble' Write-Host "Install to $installdir" try { - Start-Process -FilePath $outfile -ArgumentList "/S /D=$installdir" -Wait + $installdir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($installdir) + $adminflag = "/NOADMIN " + try { + $tempfolder = New-Item "$installdir-$PID-temp" -ItemType Directory + Remove-Item $tempfolder.FullName + } catch { + $adminflag = "" + } + Start-Process -FilePath $outfile -ArgumentList "$adminflag/S /D=$installdir" -Wait } catch { writeErrorTip 'Install failed!' writeErrorTip 'Close your antivirus then try again' |
