Hi Little forest,
   I am also fighting with the same problem. Can you please help me ( if
possible give me the example of the dll), how did you identified the running
process. I had written a c# dll which gives me the status whether a given
process is running or not.
   But my installer is giving an error  *
"The installer has encountered an unexpected error installing this package.
This may indicate a problem with this package. The error code is :2762"*

Here is my test code.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
  <Product Id="{3911BB7E-BA7F-420a-9DEA-923A71520DE2}" Name="TestProduct"
Language="1033" Version="1.0.0.0" Manufacturer="King's Company">
    <Package Id="????????-????-????-????-????????????"
Description="Description of your product" Comments="This will appear in the
file summary stream." InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="TestDir" Name="TestDir" LongName="Test Directory">

          <Component Id="Comp1"
Guid="{11DFDCEB-7C5F-480c-B0E1-6EF202149497}">
            <!-- TODO: Insert your files, registry keys, and other resources
here. -->
            <File Id="file" Name="Monk.pdf" Source="m.pdf" DiskId="1"/>
          </Component>

        </Directory>
      </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="Feature Title" Level="1">
      <ComponentRef Id="Comp1" />
    </Feature>

    <Binary Id="CHECKFOROTHERPROCESS" SourceFile="PPC.dll"/>
    <CustomAction Id="FindOtherProcess" BinaryKey="CHECKFOROTHERPROCESS"
DllEntry="CheckPreviousInstallProcessRunning" Execute="deferred"/>

    <InstallExecuteSequence>
        <!--<Custom Action="FindOtherProcess" After="LaunchConditions"/>-->
        <Custom Action="FindOtherProcess" Before="CostFinalize"/>
    </InstallExecuteSequence>

    <Condition Message="Another Instance of installer is already
running">CHECKFOROTHERPROCESS="0"</Condition>

  </Product>
</Wix>


and the c# dll is
using System;
using System.Diagnostics;

namespace PrviousProcessChecking
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class Class1
    {
        public static int CheckPreviousInstallProcessRunning ()
        {
            //
            // TODO: Add code to start application here
            //

            Process[] procs = Process.GetProcesses ();

            foreach (Process p in procs)
                try
                {
                    if (p.MainModule.ModuleName == "PUnin.exe")
                        return 1;
                }
                catch (Exception e)
                {
                    //Console.WriteLine ("Exception " + e.ToString ());
                }

            return 0;
        }
    }
}

Please help me. Thanks in advance.
                                                                 Regards,
                                                                 Raj

On Sat, Jan 10, 2009 at 3:31 AM, Little Forest <little.for...@ymail.com>wrote:

> It worked.
> Thanks a lot, Scott!
>
> Here is the new code in InstallUISequence:
> <InstallUISequence>
> <Custom Action="CheckingPID" Before="CostFinalize" />
> <Show Dialog="PrerequisitesDlg" After="WelcomeDlg">NOT Installed AND
> ShowProgramRunDialog = "1"</Show>
> </InstallUISequence>
>
> Brian
>
>
>
>
> ________________________________
> From: Scott Sam <s...@clearviewecm.com>
> To: General discussion for Windows Installer XML toolset. <
> wix-users@lists.sourceforge.net>
> Sent: Friday, January 9, 2009 12:07:53 PM
> Subject: Re: [WiX-users] How to detect program running and display a
> messagebox
>
> Try moving <Custom Action="CheckingIt" Before="CostFinalize" /> to the
> <InstallUISequence>.  The installUISequence runs before the
> InstallExecuteSequence.
>
> -----Original Message-----
> From: Little Forest [mailto:little.for...@ymail.com]
> Sent: Friday, January 09, 2009 2:48 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] How to detect program running and display a
> messagebox
>
> Hi Neil and Rob,
>
> Thank you for your response.
> Yes, I'm trying to do it by using CustomAction. I thought I need to do
> these things:
> 1. Write a DLL to handle the "checking if Outlook is running" work. If
> it's running, then set a property.
> 2. In the WiX code, firstly starting this checking CustomAction;
> secondly, checking that property, if it's true then show up a dialog box
> to warn the user.
> So I wrote the DLL(check.dll), and set the property
> "ShowProgramRunDialog" as 1 if Outlook is running.
> But the warning dialog box never showed up. I checked the log, here it
> is:
> Line 230: MSI (c) (B8:18) [11:26:49:677]: Skipping action:
> ProgRunDlg(condition is false)
> .....
> Line 408: MSI (s) (F4!BC) [11:26:50:302]: PROPERTY CHANGE: Adding
> ShowProgramRunDialog property. Its value is '1'.
>
> Apparently, the property "ShowProgramRunDialog" was set after the dialog
> box code part. So I wonder why it happened. How can I make sure the
> "checking if Outlook is running" task got run before "the warning dialog
> box display" statements.
>
> I realized this might be because the sequence, InstallExecuteSequence
> vs. InstallUISequence. But I don't know how to fix it. Could you please
> take a look at my code and correct me?
> Here is my code:
> <Binary Id="CheckIt" SourceFile="check.dll" />
> <CustomAction Id="CheckingIt" BinaryKey="CheckIt" DllEntry="CheckIt" />
> <InstallExecuteSequence>
> <Custom Action="CheckingIt" Before="CostFinalize" />
> </InstallExecuteSequence>
> <UI>
> <Dialog Id="ProgRunDlg" ...>
>      ... define the dialog ...
> </Dialog>
> <InstallUISequence>
> <Show Dialog="ProgRunDlg" After="WelcomeDlg">NOT Installed AND
> ShowProgramRunDialog = "1"</Show>
> </InstallUISequence>
> </UI>
>
> Thanks you all!
>
> Brian
>
>
> ________________________________
> From: Rob Mensching <rob.mensch...@microsoft.com>
> To: General discussion for Windows Installer XML toolset.
> <wix-users@lists.sourceforge.net>
> Sent: Thursday, January 8, 2009 10:30:56 PM
> Subject: Re: [WiX-users] How to detect program running and display a
> message box
>
> You *can* do it v2.  You just need to write the CustomAction or port
> CloseApplication down... lots more work than v3.
>
> -----Original Message-----
> From: Neil Sleightholm [mailto:n...@x2systems.com]
> Sent: Thursday, January 08, 2009 22:24
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] How to detect program running and display a
> message box
>
> I don't think you can do this in v2 but in v3 you can use
> <util:CloseApplication />
>
> Neil
>
> -----Original Message-----
> From: Little Forest [mailto:little.for...@ymail.com]
> Sent: 08 January 2009 22:16
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] How to detect program running and display a message
> box
>
> I'd like to do these in 2.0:
> 1. Detect if a program(e.g. Outlook.exe) is running
> 2. If it's running, display a message box to ask the user to close it;
> if it's not running, don't show it and keep installing process.
>
> Can any one give some code example?
>
> Thanks in advance.
>
> Brian
>
>
>
>      __________________________________________________________________
> Ask a question on any topic and get answers from real people. Go to
> Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
> ------------------------------------------------------------------------
> ------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ------------------------------------------------------------------------
> ------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------
> ------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
>      __________________________________________________________________
> Looking for the perfect gift? Give the gift of Flickr!
>
> http://www.flickr.com/gift/
> ------------------------------------------------------------------------
> ------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
>       __________________________________________________________________
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
> favourite sites. Download it now at
> http://ca.toolbar.yahoo.com.
>
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to