i'm interpreting here but i assume an app on your desktop pc will collect
info from the user and then decide what cab files to install on the pocket
pc. i assume this b/c if you copy a cab file to the pocket pc, it will
install it automatically...so to have choices on what to install is a mute
point...you'd have already installed all the cabs you moved to the pocket
pc.
anyway, create the cabs for every solution you plan to have as a "choice" to
install. next, create your desktop installer application. place this code to
un/install the selected choice: (asserts that the targetedSoftware is a
string representing a directory relative to the installer's path)
imports microsoft.win32
imports system.diagnostics
imports system.io
private const regPath as string =
"software\microsoft\windows\currentversion\app paths\ceappmgr.exe"
private enum installAction
install = 0
uninstall = 1
end enum
private sub installSoftware(byval targetedSoftware as string, byval
installAction as installAction)
dim iniFile as string
if installAction = installAction.install then iniFile =
path.combine(system.appdomain.currentdomain.basedi rectory, targetedSoftware
& "\setup.ini")
launchAppManager(iniFile)
end sub
private sub launchAppManager(byval iniFile as string)
dim key as registrykey = registry.localmachine.opensubkey(regPath)
dim appManager as string = cstr(key.getvalue(""))
if appManager is nothing then
dim m as string
m &= "CE Application Manager could not be found." & vbcrlf & vbcrlf
m &= "Please make sure it is correctly installed on this computer."
msgbox(m, msgboxstyle.critical, "Error - Client Installation"
return
end if
if iniFile is nothing then
process.start(string.format("""{0}""", appManager))
' uninstall
else
process.start(string.format("""{0}""", appManager),
string.format("""{0}""", iniFile)) ' install
endif
end sub
you will also need to create a setup program for each application you want
to install - it will include a setup.ini file that tells the ce app manager
what processors are supported by your application. finally, create a setup
program for your main installer application. it should include the cab files
for all of your solutions that may be optionally installed. do this in a
SEPARATE folder for each solution. you'll then need to create the psuedo
installation directory structure using the same folder names as will be
passed to the installSoftware targetedSoftware argument. in each of these
folders should be a link to their respective cab files.
that's pretty robust and on the money...i use this code religiously. i found
a hugely complex routine for installing apps to pocket pc's on msdn. all i
really needed to know was how to launch the app manager with a way for it to
point to the application i wanted to install. i digress. anyway, my textual
step-by-step is more complex in language than in action...this whole thing
shouldn't take a novice more than two hours and a pro less than 10 minutes.
it's quite simple once you know what's going on.
hth,
steve
"Krishnan Margabandhu" <Kr******************@target.com> wrote in message
news:2c*****************************@phx.gbl...
I'm writing a Pocket PC app that will run when a device
is first powered on. I want this program to get some data
from the user and invoke a CAB file to install a software
on the device. How do I invoke a CAB file from the VB app?
Thanks