Your custom action effectively says "Run version 2.0 of mainapp.exe after it's 
been installed on the system". Version 1.0 is running when you do the upgrade. 
It cannot replace MainApp.exe unless it can be completely shut down.  The 
purpose of the FilesInUse dialog is to ask the user to manually shut it down. 
There's no automatic shutdown.  FilesInUse isn't really linked with a custom 
action, except that you've forced it to be linked by creating a custom action 
to run a program that cannot be installed on the system until after a reboot.


Phil Wilson


-----Original Message-----
From: little.forest [mailto:little.for...@ymail.com]
Sent: Friday, October 02, 2009 4:02 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to add FilesInUse support

Thanks Phil! I really appreciate your reply and your time.


"If MainApp running and FilesInUse does not shut it down, then it cannot be 
replaced on the system, so it can't be run."
- Correct. This is why we need to put this FilesInUse in. Here are what I 
experienced:
- the old version running
- start running the new version installer
- a few seconds, the FilesInUse dialog showed up
- I manually exit the old version of application
- the new version installation process kept going.. a few seconds, the build 
failed Error 2753
- go to the "Program Files" folder, the application folder wasn't even created.

"Is it doing something that requires it to be a custom action actually being 
installed onto the system? I'm thinking it can be in the Binary table, 
depending on why it's being run."
- Our application is a .NET 3.5 WPF based application. The application is 
written in C#. There is a perform issue. Every time when the application 
startup, it'll take a fair mount of time to start. So the development team came 
up with an idea. The idea is, right after the installation and before the end 
user launching the application, start the "bootloader" by using the main 
application with a command line argument(something like "mainapp.exe 
-bootload"). Note: the main application name is mainapp.exe. If we "real" run 
the application, the same mainapp.exe will be executed. What this "-bootload" 
does is that it will start some services, load some DLL files etc. I'm not sure 
whether this design is good or not. But it does work fine. When the end user 
launch the application, she will feel the application is fast - because 
services and DLLs already loaded. So we need this custom action to start this 
bootloader in installer. Actually, you know, this
 bootloader is the same as the main application, but just with an argument. 
Will this cause problem? But why there is no any files installed? The 
application folder not even created? I did schedule this custom action before 
"InstallFinalize" which is almost the end of the installation. I use custom 
action type 18 because the executable(actually it's the main application) is 
installed with the application, and I need to set the command line argument. Is 
this the problem?

So one thing worth noticing, if there is no old version running, everything is 
fine. I'm really puzzled.

Thanks again, Phil.

/Brian



________________________________
From: "Wilson, Phil" <phil.wil...@wonderware.com>
To: General discussion for Windows Installer XML toolset. 
<wix-users@lists.sourceforge.net>
Sent: Friday, October 2, 2009 3:07:36 PM
Subject: Re: [WiX-users] How to add FilesInUse support

If MainApp running and FilesInUse does not shut it down, then it cannot be 
replaced on the system, so it can't be run.  Is it doing something that 
requires it to be a custom action actually being installed onto the system? I'm 
thinking it can be in the Binary table, depending on why it's being run.

Phil Wilson


-----Original Message-----
From: little.forest [mailto:little.for...@ymail.com]
Sent: Friday, October 02, 2009 2:43 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to add FilesInUse support

Hi Phil,


Thanks for you reply.

It's good to know that "2753 is nothing directly related to FilesInUse".

For "It's typically caused by running a custom action referring to a program 
that is not going to be installed.  So it looks like you're asking to run 
MainApp but the one in your setup isn't being installed." - It's true. We do 
have a custom action like this(Does this code look okay?):
<CustomAction Id="ExecBootloader_Cmd"
FileKey="MainApp"
ExeCommand="-bootload"
Execute="deferred"
Return="ignore"
HideTarget="no"
Impersonate="no"
/>

<InstallExecuteSequence>
<Custom Action="ExecBootloader_Cmd" Before="InstallFinalize" />
</InstallExecuteSequence>


As long as the old version wasn't running, the major upgrade worked fine. I 
mean, there wasn't error, the old version was removed, and the new version was 
installed. The custom action run okay as well. But, if the old version was 
running, we did see something different: we see the FilesInUse dialog, we 
shutdown the old version manually, so far so good, we kept it going.. then it 
failed. I noticed the application folder under "Program Files" was not even 
created. Netherless to say, anything new version wasn't installed. So when the 
custom action was triggered, the program can't be found, then error. So in 
here, it seems to me that the only difference is whether "the old version is 
running" and further "FilesInUse".

So for "This can because there's a component or feature state that means it's 
not being installed, or yours isn't being installed because there's already one 
on the system with a higher version." - I doubt if it's about the version 
higher/lower. Because if this is true, then we couldn't explain why the new 
version was installed and run okay while the old version wasn't running. It's 
suppposed to fail even the old version wasn't running, right?

Again, the only difference is the "old version running". If not running, no 
FilesInUse showing up, things are okay. If running, the FilesInUse part behave 
correctly but nothing will be installed. So I guess this is about FilesInUse. 
But, really, I don't know the reason and the solution.

By the way, we use WiX version 3.0.4805.0.

If you have any idea, please let me know.

Thanks a lot.

/Brian




________________________________
From: "Wilson, Phil" <phil.wil...@wonderware.com>
To: General discussion for Windows Installer XML toolset. 
<wix-users@lists.sourceforge.net>
Sent: Friday, October 2, 2009 1:57:16 PM
Subject: Re: [WiX-users] How to add FilesInUse support

2753 is nothing directly related to FilesInUse - look up the Windows SDK 
Windows Installer errors for this kind of thing.

It's typically caused by running a custom action referring to a program that is 
not going to be installed.  So it looks like you're asking to run MainApp but 
the one in your setup isn't being installed. This can because there's a 
component or feature state that means it's not being installed, or yours isn't 
being installed because there's already one on the system with a higher version.

Phil Wilson


-----Original Message-----
From: little.forest [mailto:little.for...@ymail.com]
Sent: Friday, October 02, 2009 12:07 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to add FilesInUse support

Let me correct something a bit:

If not add "<DialogRef Id="FilesInUse" />" line, the installation is okay but 
it won't detect and show "FilesInUse" dialog.
If add "<DialogRef Id="FilesInUse" />" line in code, the installation is okay 
if this is a fresh intallation(fresh means no previous version installed).
If add "<DialogRef Id="FilesInUse" />" line in code, and there is the old 
version application running, then the installation of the new version will 
detect and show the "FilesInUse" dialog which is good. But later on the 
installation of the new version will be failed because of an Error called 2753. 
Why this happens? How to resolve it?

Thanks.



________________________________
From: little.forest <little.for...@ymail.com>
To: wix-users@lists.sourceforge.net
Sent: Friday, October 2, 2009 11:17:01 AM
Subject: [WiX-users] How to add FilesInUse support

We use WiX 3.0.

We have a problem: the end user is running the old version of the application, 
but she tries to install the new version at the same time. As we use major 
upgrade, the old version will be uninstalled first. So in this case, if the old 
version is running, we can't install the new version properly.

I knew "util:CloseApplication". So I tried that. But in our application, there 
is a requirement "close application will just minimize the GUI to system tray 
just like Yahoo Messenger". I'm not sure if "util:CloseApplication" does send 
WM_CLOSE message to our application. But even if it does, our application will 
just minimize itself to system tray but not close itself. We already tested it. 
The application didn't shut down. So we can't use this "util:CloseApplication".

Then I tried another solution: 
http://n2.nabble.com/Custom-action-sequencing-problem-td709311.html#a709311
Well, it partly worked. If we keep the old version running, then the process is 
killed when installing the new version. However, just a few seconds later, the 
installation failed because of "Error code 2753". I realized the old version 
was uninstalled, the new version wasn't installed. Also, I was thinking killing 
a process directly might not be a good thing. So I kept searching other 
solutions.

Then I found someone said "FilesInUse". I think this solution even works for 
us. So I added this line:
<UI>
<DialogRef Id="FilesInUse" />
...
</UI>

Now we have new problem "Error code 2753". I tried two cases:
Case 1: I kept the old version running, and I installed the new version. During 
installation, the "FilesInUse" dialog did show up - I was very happy. Then I 
exited the old version. The installation kept going.. just a few seconds, it 
failed. I noticed the old version was uninstalled, but the new version wasn't 
installed. Here is the log:
MSI (s) (48:4C) [10:15:34:839]: Note: 1: 2753 2: MainApp
MSI (s) (48:4C) [10:15:34:839]: Note: 1: 2205 2:  3: Error
MSI (s) (48:4C) [10:15:34:839]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` 
FROM `Error` WHERE `Error` = 2753
DEBUG: Error 2753:  The File 'MainApp' is not marked for installation.
The installer has encountered an unexpected error installing this package. This 
may indicate a problem with this package. The error code is 2753. The arguments 
are: MainApp, ,
MSI (s) (48:4C) [10:15:44:245]: Note: 1: 2205 2:  3: Error
MSI (s) (48:4C) [10:15:44:245]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` 
FROM `Error` WHERE `Error` = 1709
MSI (s) (48:4C) [10:15:44:245]: Product: BigAppleProduct -- The installer has 
encountered an unexpected error installing this package. This may indicate a 
problem with this package. The error code is 2753. The arguments are: MainApp, ,
The log says error, but what the error means? What caused this error? The log 
didn't say.

Case 2: do a fresh installation. There is no "FilesInUse" dialog showing up, of 
course. But the install still failed - Error 2753. This doesn't make any sense.

It seems the problem is this new added line "<DialogRef Id="FilesInUse" />". By 
adding this line, the error 2753 is introduced. Why is that? So how can I add 
this FilesInUse support in WiX 3? Where I did wrong here?

Many many thanks.
/Brian


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



      __________________________________________________________________
The new Internet Explorer(r) 8 - Faster, safer, easier.  Optimized for Yahoo!  
Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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/
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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/
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to