FileDeployer.DownloadPackage-Methode
Aktualisiert: November 2007
Lädt ein Paket auf der Grundlage der jeweiligen Paket-ID, die einer bestimmten CPU entspricht, auf das Gerät herunter.
Namespace: Microsoft.SmartDevice.Connectivity
Assembly: Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)
Syntax
'Declaration
Public Sub DownloadPackage ( _
packageId As ObjectId _
)
'Usage
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
)
Parameter
packageId
Typ: Microsoft.SmartDevice.Connectivity.ObjectIdEindeutige Paket-ID.
Hinweise
Installationspakete wie die Pakete zur Installation von .NET Compact Framework und SQL Server Compact 3.5 werden nicht automatisch ausgeführt, nachdem der CAB-Installer auf dem Gerät bereitgestellt wurde. Bei der Installation müssen Sie Microsoft.SmartDevice.Connectivity.RemoteProcess manuell verwenden, um die Installation zu starten.
Beispiele
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", "");
Berechtigungen
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.