views:

328

answers:

1

I'm having trouble using macros in my .inf file that I'm using to create my cab, specifically when setting the InstallDir string. If I do something like this:

InstallDir=\<PathToProgramFiles>\MyAppName

then everything works fine. However, if I do this:

InstallDir=%CE1%\MyAppName

then I get the following error when trying to install the cab (double tapping it on my device): "MyAppName was not installed successfully. Please run Setup again."

This only seems to apply to the built-in macro strings. I can use %AppName% without any problems. Maybe there is some registry setting that isn't properly set that would normally resolve the %CE1% macro?

Any ideas about what is going on?

Edit: My device doesn't have a \Program Files directory. It seems the %CE1% macro always resolves to that path and if the InstallDir specified in the inf file doesn't exist (with the exception of the last directory portion then the install fails. Manually creating \Program Files fixed the issue. Since a lot of the devices I'm working with have different paths for their Program Files directory, is there a generic way to get the installer to default to the actual Program Files dir? I guess my only other option is to not specify a path and force the user to choose one?

A: 

First, in this link you can find the shortcuts and their meaning (the %C..%), goto appendix B. The Windows CE5 MSDN link.

You can add a Setup Dll to your CAB installaer that will check the directory structure and will create a folder in case it does not exist. You may find this SO question useful.

A warning: If you are targeting regular Windows CE devices, beware where you place the files as it can be to a RAM based file system and then the files will disappear after reboot.

Shaihi
Thanks for the info. I think my problem is that ultimately the macros as defined are meant to be used for localization purposes and not the same as looking up the real path (e.g. SHGetSpecialFolder()). I think I'm ultimately going to have to build my own installer that properly deals with these differences. It doesn't look like a custom setup DLL will allow me to tweak the install path...
Jason