使用DSC cChocoPackageInstaller通过Chocolatey安装DotNet 4.6.1失败 [英] Failure Installing DotNet 4.6.1 via Chocolatey using DSC cChocoPackageInstaller

查看:141
本文介绍了使用DSC cChocoPackageInstaller通过Chocolatey安装DotNet 4.6.1失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过ARM模板和DSC在Azure中设置服务器Windows 2012 R2。 DSC脚本运行cChocoPackageInstaller来安装dotnet4.6.1(在运行cChocoInstaller之后)。看起来像这样:

I'm attempting to set up a server Windows 2012 R2 in Azure via ARM templates and DSC. The DSC script runs the cChocoPackageInstaller to install dotnet4.6.1 (after running the cChocoInstaller). It looks like this:

cChocoInstaller Choco
{
    InstallDir = "c:\choco"
}

cChocoPackageInstaller DotNet461 
{            
    Name = "dotnet-461" 
    DependsOn = "[cChocoInstaller]Choco" 
} 

DotNet安装程序已下载,但最终在运行时失败。日志看起来像这样(我只摘录了这里的错误)。

The DotNet installer is downloaded but it ultimately fails when it is run. The log looks like this (I've excerpted just the errors here).

2016-06-17 13:05:52,001 [DEBUG] - Running 'Start-ChocolateyProcessAsAdmin' with exeToRun:'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\dotnet-461\4.6.01055.006\NDP461-KB3102436-x86-x64-AllOS-ENU.exe', statements: '/q /norestart /log "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\net461.log" ' 
2016-06-17 13:05:52,001 [DEBUG] - Elevating Permissions and running ["C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\dotnet-461\4.6.01055.006\NDP461-KB3102436-x86-x64-AllOS-ENU.exe" /q /norestart /log "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\net461.log" ]. This may take a while, depending on the statements.
2016-06-17 13:05:52,110 [DEBUG] - Setting RunAs for elevation
2016-06-17 13:05:53,487 [INFO ] - The application cannot find one of its required files, possibly
2016-06-17 13:05:53,487 [INFO ] - 
2016-06-17 13:05:53,487 [INFO ] - because it was unable to create it in the folder. Please make
2016-06-17 13:05:53,487 [INFO ] - 
2016-06-17 13:05:53,487 [INFO ] - sure that the folder in which this application was downloaded is
2016-06-17 13:05:53,487 [INFO ] - 
2016-06-17 13:05:53,487 [INFO ] - accessible and not read-only.
2016-06-17 13:05:53,487 [INFO ] - 
2016-06-17 13:05:53,503 [DEBUG] - Command ["C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\dotnet-461\4.6.01055.006\NDP461-KB3102436-x86-x64-AllOS-ENU.exe" /q /norestart /log "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\net461.log" ] exited with '3'.
2016-06-17 13:05:53,518 [ERROR] - ERROR: Running ["C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\dotnet-461\4.6.01055.006\NDP461-KB3102436-x86-x64-AllOS-ENU.exe" /q /norestart /log "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\chocolatey\net461.log" ] was not successful. Exit code was '3'. See log for possible error messages.
2016-06-17 13:05:53,518 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'c:\choco\helpers\chocolateyInstaller.psm1'; & 'c:\choco\helpers\chocolateyScriptRunner.ps1' -packageScript 'c:\choco\lib\dotnet-461\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '3'.
2016-06-17 13:05:53,534 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2016-06-17 13:05:53,549 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'

有几件事:


  • 没有为DotNet安装程序...因此它似乎无法成功启动安装程序。

  • 安装程序包肯定已下载到预期的位置。不知道为什么它能够将安装程序下载到此目录,但是以后却无法访问/运行它。

  • 如果我将RDP放到盒子上并运行 choco install dotnet4.6.1

  • 我现在正在运行choco 0.9.10,但是在0.9.9中也有同样的问题

  • 我正在运行dotnet4.6.1安装程序的较新版本(未批准),该安装程序以/ q(完全)模式而不是/ passive运行。在被动模式下,我遇到了同样的问题。

  • No log file is produced for the DotNet installer...so it doesn't look like it's successfully launching the installer.
  • The installer package is definitely downloaded to the expected location. Not sure why it would be able to download the installer to this directory but then later not access/run it.
  • If I RDP onto the box and run the "choco install dotnet4.6.1" command as a local admin the package installs with no errors.
  • I'm now running choco 0.9.10 but had the same issue with 0.9.9
  • I'm running the newer version of the dotnet4.6.1 installer (unapproved) that runs in /q (quite) mode instead of /passive. I had the same issue in Passive mode.

任何想法都值得赞赏。谢谢!

Any ideas are appreciated. Thanks!

推荐答案

虽然没有说这是最好的答案,但这两者都可以通过Chocolatey进行(直接从CustomScript ARM扩展启动) ),或通过DSC(使用拉式服务器和.Net 4.6.1的自定义DSC模块)(从ARM模板启动)。下面是我的ChocolateyInstall.ps1。我基本上是手动进行安装,而不是依靠巧克力般的安装功能。这来自以下SO问题,该问题在4.5.2中使用了此方法。

Not saying this is the best answer possible, but this works both via Chocolatey (launched directly from a CustomScript ARM extension) or via DSC (using a pull server and a custom DSC module for .Net 4.6.1) when either is initiated from an ARM template. Below is from my chocolateyInstall.ps1. I'm basically manually conducting the install instead of relying on the chocolatey install functionality. This came from the following SO question which used this approach for 4.5.2.

Function IsInstalled {
    $ver = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full').Release
    return (!($ver -eq $null) -and ($ver -ge 394254))
}

if (IsInstalled) {
    Write-Host "Microsoft .NET Framework 4.6.1 or later is already installed"
}
else {
    $SourceURI = "https://download.microsoft.com/download/3/5/9/35980F81-60F4-4DE3-88FC-8F962B97253B/NDP461-KB3102438-Web.exe"
    $FileName = $SourceURI.Split('/')[-1]
    $BinPath = Join-Path $env:SystemRoot -ChildPath "Temp\$FileName"

    if (!(Test-Path $BinPath))
    {
        Invoke-Webrequest -Uri $SourceURI -OutFile $BinPath
    }

    write-verbose "Installing .Net 4.6.1 from $BinPath"
    write-verbose "Executing $Binpath /q /norestart"
    Sleep 5
    Start-Process -FilePath $BinPath -ArgumentList "/q /norestart" -Wait -NoNewWindow            
    Sleep 5
    Write-Verbose "DotNet 4.6.1 Install completed"
}

这篇关于使用DSC cChocoPackageInstaller通过Chocolatey安装DotNet 4.6.1失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆