When creating a CAB file you are required to set the InstallDir
attribute under the [CEStrings] section of the CAB .inf file.
My problem is that I'm not sure where I want to install the CAB file
until the last possible second, as the CAB file is being installed.
This is well after the CAB file has been built.
In Mobile 4.2 you were able to override the InstallDir attribute at the
last possible second by setting a registry value at
[HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft Application
Installer\Install]. You would set the registry value for your app, call
"wceload.exe /noaskdest", and then wceload would look at this registry
key for where to install the contents of your CAB. (This is described
at
http://blog.opennetcf.org/afeinman/CommentView,guid,1de2284c-a65e-417c-a130-1bd5acd4ad3d.aspx)
This no longer works in Windows Mobile 5.0. I know for sure that
wceload still looks at that registry key, because if you just call
"wceload.exe" it will install all the CABs listed in that key. The
problem is that no longer overrides the InstallDir attribute. I've
tried all combinations of command line switches (e.g. /silent, /noui) as
well as signing the CAB, to no avail. In my search for an answer I
found that you can create a setup.dll to accompany your CAB, which has
four functions called by wceload. One of the functions is Install_Init,
described at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/APISP/html/sp_ce_setup_install_init.asp
One of the parameters passed in is the install directory. I thought
it'd be sweet if I could modify that in memory and accomplish my goal.
This doesn't seem possible though because it's specified as an [in]
parameter.
Anyone have any suggestions?