wceload.exe and /noaskdest in WM5?

G

Guest

I've read several posts stating that utilizing the /noaskdest switch with the
desired install path entered into the registry at
"HKLM\software\apps\microsoft application installer\Install" is no longer
supported in WM5. I'm quite puzzled by this, since it seems to be such a
needed feature. What we're trying to do is install the CAB silently, but
using the /silent switch, and have it install to the storage card. I realize
we can adjust the default path in the CAB file, but that only applies when
it's our own CAB file. What if we want to do this with someone elses? Is
there any workaround or is this now impossible?


Thanks,
(e-mail address removed)
 
R

Richard Jones

I've read several posts stating that utilizing the /noaskdest switch with the
desired install path entered into the registry at
"HKLM\software\apps\microsoft application installer\Install" is no longer
supported in WM5. I'm quite puzzled by this, since it seems to be such a
needed feature. What we're trying to do is install the CAB silently, but
using the /silent switch, and have it install to the storage card. I realize
we can adjust the default path in the CAB file, but that only applies when
it's our own CAB file. What if we want to do this with someone elses? Is
there any workaround or is this now impossible?

Thanks,
(e-mail address removed)

I've had exactly the same issue. I resigned myself to the fact
that a silent install just isn't possible. :-(

Richard ( http://www.binaryrefinery.com )
 
N

Neville Lang

Due to the change in the security mechanism in Windows Mobile 5.0 and
ActiveSync 4.x, for a silent download, you need to change the design of the
download so that the CAB file is transported by ActiveSync onto the PPC.
This change allows ActiveSync to track the installation so that when you
uninstall the app via ActiveSync, it will know where to remove all parts of
the app.

I am just going out at the moment. When I am back, I will pass on the
changes I made in my Custom Installer for WM5 and WM6 devices.

Regards,
Neville Lang
 
G

Guest

It's really strange. We're rolling out a deployment of 150 WM5 devices, and
we're using Soti MobiControl to manage the devices. MobiControl leverages
wceload to assist in the remote deployment of apps, which is great, but it
seems that if we want to do the install silently, then it must be our own CAB
file. If the CAB we are deploying is not under our control (commercial
code), then our only choice is to install to the default location silently or
not do a silent install. Maybe there's more to it than meets the eye, but
from where I'm standing it just seems like such a basic and obvious need that
must be so simple to fix, especially since it worked before. I wonder if
there are any similar but alternative utilities like wceload?

Roby2222
 
N

Neville Lang

In going over my custom installer code from a few years ago, I now remember
that someone from Microsoft strongly recommended that we now install apps
onto WM5 (and now WM6) devices by using ActiveSync's CeAppMgr.exe and not
the WCELOAD.EXE on the device as we were used to in previous device
operating systems. As you can see from the code snippet, I first detect
whether the device is using WM5 or later and switch the method of CAB
delivery. My code has been working fine on WM 2003, WM5 devices and also on
WM6 devices. My app is a consumer app so it needs to be able to install onto
any of our customers Pocket PCs or Pocket PC phones.

Though this code may not be exactly what you are looking for, I hope it is
of use in understanding the way we went after using the hint from the
Microsoft person.

Regards,
Neville Lang

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*** My Custom Installer class (partial code) ***



// Class fields

private const string CEAPPMGR_PATH =
@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\CEAPPMGR.EXE";

private const string ACTIVESYNC_INSTALL_PATH = @"SOFTWARE\Microsoft\Windows
CE Services";

private const string INSTALLED_DIR = "InstalledDir";

private const string CEAPPMGR_EXE_FILE = @"CEAPPMGR.EXE";

private const string CEAPPMGR_INI_FILE = @"MyApp.ini";

private const string APP_SUBDIR = @"\MyAppFolder";

private const string ACTIVESYNC_EXE_FILE = "WCESMGR.EXE";

private const int BASE_AS = 371; // Base value for ActiveSync private
bool bWM5 = false; // Windows Mobile 5.0 (or later) private
const int WM_MIN_VERSION = 5; // WM5 or later





private bool MyInstaller(string MsiSource, string MsiTarget)

{



string strProdCab1 = "MyApp_PPC.ARM.cab";

string strProdCab2 = "MyApp_PPC.ARMV4.cab";



....

....



//--- Check the version of ActiveSync --------

if (! CheckActiveSync() )

{

return false;

}



// Initialise RAPI

if (!RAPI.IsDeviceConnected(5000))

{

HandleErrors(23);

return false;

}



//--- Get the Operating System version on the device ------------------

RAPI.CEOSVERSIONINFO DeviceOS = new RAPI.CEOSVERSIONINFO();

int iRet = RAPI.CeGetVersionEx(out DeviceOS);

if (iRet == 0)

{

HandleErrors(24);

return false;

}

// Check if the Device's operating system is WM5 or later

if (DeviceOS.dwMajorVersion >= WM_MIN_VERSION)

{

this.bWM5 = true;

}





....

....





if (this.bWM5)

{

// Find the location where the application will be installed

string installPath = this.GetAppInstallDirectory();



// Create target directory off the ActiveSync folder for my App

Directory.CreateDirectory(installPath);



// Copy the two CABs and AppMgr INI file to the ActiveSync directory

System.IO.File.Copy(Path.Combine(MsiTarget, strProdCab1),
Path.Combine(installPath, strProdCab1), true);

System.IO.File.Copy(Path.Combine(MsiTarget, strProdCab2),
Path.Combine(installPath, strProdCab2), true);

System.IO.File.Copy(Path.Combine(MsiTarget, strProdCabIni),
Path.Combine(installPath, CEAPPMGR_INI_FILE), true);



// Get the path to CeAppMgr.exe

RegistryKey keyAppMgr = Registry.LocalMachine.OpenSubKey(CEAPPMGR_PATH);

string appMgrPath = (string) keyAppMgr.GetValue(null);

keyAppMgr.Close();



// Run CeAppMgr.exe to install the files to the device

Process.Start(appMgrPath, "\"" + Path.Combine(installPath,
CEAPPMGR_INI_FILE) + "\"");

}

else // True if device o/s earlier than WM5

{



...

...



RAPI.PROCESS_INFORMATION info = new
CustomInstaller.RAPI.PROCESS_INFORMATION();



Cursor.Current = Cursors.WaitCursor;



RAPI.CopyFileToDevice(MsiTarget + strProdCab2, @"\" + strProdCab2,
true);

RAPI.CeCreateProcess("WCELOAD.EXE", "/noui /noaskdest " + @"\" +
strProdCab2, 0, 0, 0, 0, 0, null, 0, ref info);



Cursor.Current = Cursors.Default;



}





} // MyInstaller method





//=====================================================



private bool CheckActiveSync()

{

if (Environment.OSVersion.Version.Major < 6) // True if Windows
version is not Vista

{

// First check if ActiveSync installed on main computer by
checking for the Windows CE Services key

RegistryKey regkey =
Registry.LocalMachine.OpenSubKey(ACTIVESYNC_INSTALL_PATH);

if (regkey == null)

{

HandleErrors(17);

return false;

}



// Get the path where ActiveSync installed

string strInstallPath =
Convert.ToString(regkey.GetValue(INSTALLED_DIR));

if (strInstallPath == "") // True if this value not found

{

HandleErrors(17);

return false;

}

regkey.Close();



// Check the version of ActiveSync on the desktop

string strFilename = strInstallPath + @"\" +
ACTIVESYNC_EXE_FILE;

if (System.IO.File.Exists(strFilename))

{

FileVersionInfo myFVI =
FileVersionInfo.GetVersionInfo(strFilename);

int currentAS = (myFVI.FileMajorPart * 100) +
(myFVI.FileMinorPart * 10) + myFVI.FileBuildPart;

if (currentAS < BASE_AS)

{

HandleErrors(15);

return false;

}

}

else

{

HandleErrors(16);

return false;

}

}



return true;

}

//=====================================================



private string GetAppInstallDirectory()

{

// Get ActiveSync install directory

RegistryKey keyActiveSync =
Registry.LocalMachine.OpenSubKey(ACTIVESYNC_INSTALL_PATH);

if (keyActiveSync == null)

{

throw new Exception("ActiveSync is not installed !!");

}



// Build target directory path under the Activesync folder

string activeSyncPath = (string)
keyActiveSync.GetValue(INSTALLED_DIR);

string installPath = activeSyncPath + APP_SUBDIR;

keyActiveSync.Close();



return installPath;

}

//=====================================================



MyApp.ini (Below are the lines in this text file)

---------

[CEAppManager]

Version = 1.0

Component = MyApp



[MyApp]

Description = MyApp - An application for the Pocket PC

CabFiles = MyApp_PPC.ARMV4.cab,MyApp_PPC.ARM.cab



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
G

Guest

Neville, thanks very much! We're going to pursue this option. I appreciate
the help.

Thanks,
Roby2222
 
N

Neville Lang

Hi Roby2222,

Sorry about the spacing in the code snippet, it seems to have double spaced
all lines. I am glad this code was useful to you.

Regards,
Neville Lang
 
G

Guest

This is fine whn deploying locally, but not when deploying OTA (Over-The-Air)
via GPRS/UMTS etc.
 
N

Neville Lang

Hi Simon,

You are correct to say that there is also the OTA option for installation.

Because our app is a consumer app we ship it on a CD or by website download,
and because there is also a desktop-side set of EXEs that need to be
installed (so that the device app can interact with a 3rd party PC app),
installation of our app needs to be done via the desktop. Consequently, we
use the ActiveSync approach to installation and have developed custom
Installer code that installs our app's EXEs on both the device and desktop
side in one go.

Regards,
Neville Lang
 
G

Guest

In your case the new way the wceload.exe works is ok. But unfortionately, we
don't have that luxury as we need to deploy remotely from a gateway server to
now around 2,000 units that our client has. This number will continue to rise
which rule out manually updating all devices.

Will try and speak to the Windows Mobile Team on the reasoning behind the
wceload.exe change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top