views:

161

answers:

1

I know about WIXUI_EXITDIALOGOPTIONALCHECKBOX and WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT.

As I understand it, those things can be used to trigger a custom action.
The examples I've seen run an EXE, or invoke a custom action in code.

How can I run a .CHM file if the checkbox is checked?

If I just specify the chm file as the FileKey, as below, it does not work. I think that approach works only for EXE files.

    <CustomAction Id="LaunchHelp"
                  FileKey="chmfile"
                  ExeCommand=""
                  Impersonate="yes"
                  Return="ignore"
                  />


Thanks to Sascha for the answer... This worked for me :

<CustomAction Id="LaunchHelp"
              Directory="INSTALLDIR"
              ExeCommand='[WindowsFolder]hh.exe MyHelpFile.chm'
              Execute="immediate"
              Return="asyncNoWait" />
+2  A: 

Use hh.exe to launch your CHM file, rather than launching the CHM directly. (hh.exe is what is launched when you double click on a .CHM file)

See the Microsoft HTML Help FAQ for more information.

EDIT: You can rely on hh.exe being present for all currently supported Windows versions. Who knows about future releases, but it's in the same location on all OS's I've tested on. (Win2k right through to Win7 and 2008 R2)

sascha
Good idea. is HH guaranteed to be present? Is it always in the same place? (%windir%, which I guess is [WindowsFolder] in MSI land.
Cheeso
Thank you! This worked perfectly, on my machine. Is hh.exe guaranteed to be in [WindowsFolder] on Windows XP and later?
Cheeso
You can also use `[WindowsFolder]explorer.exe anyfile` which will work for any file type, as long as it is associated with an application that can open it.
Wim Coenen

related questions