FileDeployer.DownloadPackage メソッド

更新 : 2007 年 11 月

特定の CPU に対応する指定されたパッケージ ID に基づいて、デバイスにパッケージをダウンロードします。

名前空間 :  Microsoft.SmartDevice.Connectivity
アセンブリ :  Microsoft.SmartDevice.Connectivity (Microsoft.SmartDevice.Connectivity.dll 内)

構文

'宣言
Public Sub DownloadPackage ( _
    packageId As ObjectId _
)
'使用
Dim instance As FileDeployer
Dim packageId As ObjectId

instance.DownloadPackage(packageId)
public void DownloadPackage(
    ObjectId packageId
)
public:
void DownloadPackage(
    ObjectId^ packageId
)
public function DownloadPackage(
    packageId : ObjectId
)

パラメータ

解説

.NET Compact Framework や SQL Server Compact 3.5 のインストールに使用されるようなインストール パッケージは、デバイスへの CAB インストーラの配置後に自動的に実行されるわけではありません。インストールを実行するには、Microsoft.SmartDevice.Connectivity.RemoteProcess を使用して手動でインストールを開始する必要があります。

Dim fd As FileDeployer = device.GetFileDeployer()

' Deploy .NET Compact Framework 2.0 using the ID of its add-on package.
' Add-on packages are located in \ProgramData\Microsoft\Corecon\1.0\addons
fd.DownloadPackage(New ObjectId(New Guid("ABD785F0-CDA7-41c5-8375-2451A7CBFF26")))


Dim cgautil As RemoteProcess = device.GetRemoteProcess()


' Display the version of .NET CF on the device before installation.
cgautil.Start("\windows\cgacutil.exe", "")



' Run the cab installer with no UI prompt
Dim installer As RemoteProcess = device.GetRemoteProcess()
installer.Start("wceload.exe", "/noui \windows\netcfv2.wm.armv4i.cab")
While installer.HasExited() <> True
    System.Threading.Thread.Sleep(1000)
End While

' Display the version of .NET CF on the device after installation.
If Not cgautil.HasExited() Then
    cgautil.Kill()
End If
cgautil.Start("\windows\cgacutil.exe", "")
FileDeployer fd = device.GetFileDeployer();

// Deploy .NET Compact Framework 2.0 using the ID of its add-on package.
// Add-on packages are located in \ProgramData\Microsoft\Corecon\1.0\addons
fd.DownloadPackage(new ObjectId(
    new Guid("ABD785F0-CDA7-41c5-8375-2451A7CBFF26")));


RemoteProcess cgautil = device.GetRemoteProcess();

// Display the version of .NET CF on the device before installation.
cgautil.Start(@"\windows\cgacutil.exe", "");

// Run the cab installer with no UI prompt
RemoteProcess installer = device.GetRemoteProcess();
installer.Start("wceload.exe", @"/noui \windows\netcfv2.wm.armv4i.cab");
while (installer.HasExited() != true)
{
    System.Threading.Thread.Sleep(1000);
}

// Display the version of .NET CF on the device after installation.
if (!cgautil.HasExited()) cgautil.Kill();
cgautil.Start(@"\windows\cgacutil.exe", "");

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

FileDeployer クラス

FileDeployer メンバ

Microsoft.SmartDevice.Connectivity 名前空間