Hi Rob, Thank you very much for your response.
Actually, I did read the Wix.chm and found a topic "How To: Run the Installed Application After Setup". Do you mean this topic? If it's not, then could you please tell me a few key words that I can use to search the topic? For the topic "How To: Run the Installed Application After Setup", I did copy the code and actually using it for our "luanching application when exit" case. But in our special case, besides the final "launching application when exit", we also need to run another program right after installation but before "launching the main application". Namely, we will need to run 2 program after installation: one is a small program which needs to be run before the main application startup(and it needs to run until finished); another one is the main application which is already implemented by using the code from Wix.chm. How can I do this? For "launching application when exit" case, I followed the document and got it work already. But I can't get the "run another small program" working. Also, even though the "launching application when exit" works, I'm not quite sure the meaning of the code. For example, this part(I just copy the text from Wix.chm): ............................... Step 3: Include the custom action Custom actions are included in a WiX project using the <CustomAction> element. Running an application is accomplished with the WixShellExecTarget custom action. To tell Windows Installer about the custom action, and to set its properties, include the following in your project anywhere inside the <Product> element:<PropertyId="WixShellExecTarget"Value="[#myapplication.exe]"/> <CustomActionId="LaunchApplication"BinaryKey="WixCA"DllEntry="WixShellExec"Impersonate="yes"/> The Property element sets the WixShellExecTarget to the location of the installed application. WixShellExecTarget is the property Id the WixShellExec custom action expects will be set to the location of the file to run. The Value property uses the special # character to tell WiX to look up the full installed path of the file with the id myapplication.exe. The CustomAction element includes the action in the installer. It is given a unique Id, and the BinaryKey and DllEntry properties indicate the assembly and entry point for the custom action. The Impersonate property tells Windows Installer to run the custom action as the installing user. ............................... ============================= Here are a few questions: ============================= 1. The property "WixShellExecTarget": I understand this property maybe a pre-defined property. I'll just need to define it to provide the value which is the application executable file. Does it mean I must use this property name if I need to run another program? I think the answer is NO. But then what kind of property name I should use if it's not the "launch application" case? Or it doesn't matter? Can I use some like "MyExec2", for instance? 2. For CustomAction "BinaryKey", it's "WixCA". I found the definition for "BinaryKey" from Wix.chm: ............................... This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains the custom action for use during install. The custom action will not be installed into a target directory. This attribute is typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes to specify a type 5 or 6 custom action. ............................... I guess it's a key used when launching application? Can I use it in our "run another program" case? 3. For DllEntry, it's "WixShellExec". I found the info about it: ............................... The WixShellExec custom action in wixca (part of WixUtilExtension) lets you open document or URL targets via the Windows shell. A common use is to launch readme files or URLs using their registered default applications based on their extension. Note that WixShellExecute can only be used as an immediate custom action as it launches an application without waiting for it to close. WixShellExec reads its target from the WixShellExecTarget property, formats it, and then calls ShellExecute with the formatted value. It uses the default verb, which is usually "open." For more information, see ShellExecute Function. ............................... But in our case, we need to "run that small program and wait until it finished before launching the main application" instead of "as it launches an application without waiting for it to close". Can I use this "launch application" example in our case? 4. Anyways, I thought maybe it'll work if I use the code from this example in the Wix.chm. So I had this piece of code for our small program: <Property Id="WixShellExecTarget2" Value="[#TestExe]" /> <CustomAction Id="RunMyExe" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" /> <InstallExecuteSequence> <Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom> </InstallExecuteSequence> But when I run it, I got "Setup Wizard ended prematurely" error. 5. As it doesn't work, I searched the forum for answers. Then got these code which doesn't work either: <CustomAction Id="RunTestExe" FileKey="TestExe" ExeCommand='' Return="asyncWait" /> <InstallExecuteSequence> <Custom Action="RunTestExe" After="InstallFiles">NOT Installed</Custom> </InstallExecuteSequence> I really appreciate if you or anyone else can give me some clue. We're currectly stuck on it. Many many thanks. /Brian __________________________________________________________________ Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/ ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users