2

デスクトップ エクスペリエンスを Azure ワーカー ロールにインストールする必要があります。コマンド ライン経由で DE をインストールするには、次のコマンドを使用します。

c:\servermanagercmd -install Desktop-Experience

そして、再起動が必要です。

これを Azure ワーカー ロールで最適に機能させるにはどうすればよいですか?


アップデート:

1) OS ファミリ 2 と SDK >=1.3 を使用してください。

2) 昇格したスタートアップ タスクを使用して、次のコマンドで含まれているバッチ ファイルを呼び出します。

3) servermanagercmd -install Desktop-Experience -restart -resultPath results.xml

私が試してみました

a)そのコマンドラインをbatch/.cmdファイルに入れ、昇格したスタートアップタスクを介して実行します。結果: worker ロールは中止を続け、終わりのないループで再起動します。

b) OnStart() で新しい Process() を作成しようとしましたが、昇格したランタイムの下で、次のようになりました。

ServiceDefinition.csdef:

 Runtime executionContext="elevated"

WorkerRole.cs:

public override bool OnStart()
{
   if (!System.IO.File.Exists("Startup\\InstallationFinished.txt"))
   {

      Process startup = new Process(); 

      startup.StartInfo.FileName = "Startup\\InstallDesktopExperience.cmd";
      startup.StartInfo.CreateNoWindow = true;
      startup.EnableRaisingEvents = true;
      startup.Start();
      startup.WaitForExit();

      System.IO.File.WriteAllText("Startup\\InstallationFinished.txt", 
            "Installation is complete.");

      startup.StartInfo.FileName = "Startup\\Reboot.cmd";
      startup.Start();
    }

    base.OnStart(); 
}

InstallDesktopExperience.cmd:

servermanagercmd -install Desktop-Experience

再起動.cmd:

shutdown /r

その結果、Azure Worker ロールのイベント ビューアーに、TrustedInstaller (0xc0000005) からの例外が表示されます。このエラーがイベント ログに表示された後、コマンド ライン ウィンドウを開いてコマンドを入力しても、DE を手動でインストールすることはできません。エラーが発生します:

エラー: [デスクトップ エクスペリエンス] のインストールに失敗しました。デスクトップ エクスペリエンスをインストールしようとすると、エラー コード 0x80080005 で失敗しました。サーバーの実行に失敗しました (HRESULT からの例外: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))

(ただし、OnStart でコードを実行していない場合は、コマンド ライン ウィンドウで手動で実行することで機能します)

道に迷いました。あらゆる提案を事前に感謝します。

4

1 に答える 1

1

Wage Wegner のこのガイドを参照してください。Expression Encoder を扱いますが、デスクトップ エクスペリエンスの前提条件はまったく同じです。

http://www.wadewegner.com/2011/01/using-expression-encoder-4-in-a-windows-azure-worker-role/


同じからのスニペットですが、これらの概念のいくつかについての彼の説明を読むために時間を割く必要があります

REM : Install the Desktop Experience
ServerManagerCMD.exe -install Desktop-Experience -restart -resultPath results.xml
REM : Make a folder for the AppData
md "%~dp0appdata"
REM : Change the location of the Local AppData
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f
REM : Install Encoder
"%~dp0\webpicmd\WebPICmdLine.exe" /accepteula /Products: ExpressionEncoder4 /log:encoder.txt
REM : Change the location of the Local AppData back to default
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d %%USERPROFILE%%\AppData\Local /f
REM : Exit gracefully
exit /b 0
于 2011-03-03T13:01:51.303 に答える