Método FileDeployer.DownloadPackage
Faz o download de um pacote para o dispositivo com base na ID de determinado pacote correspondente a uma CPU específica.
Namespace: Microsoft.SmartDevice.Connectivity
Assembly: Microsoft.SmartDevice.Connectivity (em Microsoft.SmartDevice.Connectivity.dll)
Sintaxe
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
)
Parâmetros
- packageId
Tipo: Microsoft.SmartDevice.Connectivity.ObjectId
ID exclusiva do pacote.
Comentários
Pacotes de instalação, sistema autônomo aqueles usados para instalar o .NET Compact estrutura e SQL Server Compact 3.5 não são automaticamente executados após a implantação do instalador CAB para o dispositivo. Para instalar, você deve usar manualmente Microsoft.SmartDevice.Connectivity.RemoteProcess Para iniciar a instalação.
Exemplos
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", "");
Permissões
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.