2017-06-23 177 views
2

我試圖下載他們到後安裝我.exe時:系統找不到指定的路徑安裝.exe和.MSI默默

wget "https://github.com/git-for-windows/git/releases/downloadv2.13.1.windows.2/Git-2.13.1.2-64-bit.exe" -outfile c:\Windows\System32\Bradford\Git-2.13.1.2-64-bit.exe 

然而,當我嘗試進行靜默安裝,無需人工互動:

C:\Windows\System32\Bradford\Git-2.13.1.2-64-bit.exe /s /v"/qn" 

我收到此錯誤:

The system cannot find the path specified. 

enter image description here

另外我不知道如何安裝.msi文件也是如此。在這種情況下,nodeJS

我正在使用AWS實例實例。具體來說:

Microsoft Windows Server 2012 R2 with SQL Server Express - ami-37b39552 
Microsoft Windows Server 2012 R2 Standard edition, 64-bit architecture, Microsoft SQL Server 2016 Express edition. [English] 
+0

@BenH對不起,shoudlve更具體。我在AWS上啓動了一個Windows實例。 'Microsoft Windows Server 2016語言環境英語,由亞馬遜提供的SQL Express 2016 AMI'這是64位 – Liondancer

+0

我認爲您需要在可執行文件名稱的前面放置。\以執行它:'。\ Git-2.13.1.2- 64-bit.exe/s/v/qn'也不認爲你需要引號。 –

+0

如果您在該文件上使用'Test-Path',結果如何? – TheIncorrigible1

回答

1

我知道如何做到這一點最簡單的方法是巧克力。

我有一些雲服務器,需要各種巧克力包,我做(類似)以下來安裝它們。我之前已經安裝了Git,並且它是完全無人值守/無提示安裝。

這是一個處理安裝和配置Chocolatey,安裝Git和更新%PATH%的簡短腳本。

<# 
.description 
Get the PATH environment variables from Machine, User, and 
Process locations, and update the current Powershell 
process's PATH variable to contain all values from each of 
them. Call it after updating the Machine or User PATH value 
(which may happen automatically during say installing 
software) so you don't have to launch a new Powershell 
process to get them. 
#> 
function Update-EnvironmentPath { 
    [CmdletBinding()] Param() 
    $oldPath = $env:PATH 
    $machinePath = [Environment]::GetEnvironmentVariable("PATH", "Machine") -split ";" 
    $userPath = [Environment]::GetEnvironmentVariable("PATH", "User") -split ";" 
    $processPath = [Environment]::GetEnvironmentVariable("PATH", "Process") -split ";" 
    $env:PATH = ($machinePath + $userPath + $processPath | Select-Object -Unique) -join ";" 
    Write-EventLogWrapper -message "Updated PATH environment variable`r`n`r`nNew value: $($env:PATH -replace ';', "`r`n")`r`n`r`nOld value: $($oldPath -replace ';', "`r`n")" 
} 

# Install Chocolatey itself: 
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression 
# NOTE: Chocolatey changes the system %PATH%, so we have to get the latest update here: 
Update-EnvironmentPath 
# Configure Chocolatey to not require confirmation when installing packages: 
choco.exe feature enable --name=allowGlobalConfirmation --yes 

# Install the package we care about 
choco.exe install git 

# Installing Git also changes the system %PATH%, so we have to update it again: 
Update-EnvironmentPath 
相關問題