Thanks Rob for analyzing this issue with me. I really appreciate your help.

So what if the user clicks installer.msi file to run the installation? What 
would be the default command line switch? What if I don't specify /i from the 
command line at all?

Can you be more specific about the Installed, REMOVE, and UPGRADINGPRODUCTCODE 
combination? I am not really familiar with all these variables.

Thanks,
zhong

-----Original Message-----
From: Rob Mensching [mailto:r...@robmensching.com]
Sent: Monday, January 07, 2013 12:01 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] how to deal with the service removal during upgrade 
and repair in WIX?

You can't do a minor upgrade with the /i commandline switch. If REINSTALLMODE 
is set it'll show up in the log file by default.

It sounds like you have a major upgrade and repair, no minor upgrades.  So you 
can use the Installed and REMOVE and UPGRADINGPRODUCTCODE properties to sort 
out all your states.


On Mon, Jan 7, 2013 at 11:51 AM, Wang, Zhongsheng <zhongsheng.w...@intel.com
> wrote:

> We don't do anything special for REINSTALLMODE at all. For MSIEXEC
> option, we only use /i and log enabling. We let MSIEXEC to figure out
> whether it is doing REINSTALL or fresh install.
>
> How do I log REINSTALLMODE information to the log file?
>
> Thanks,
> zhongsheng
>
> -----Original Message-----
> From: Rob Mensching [mailto:r...@robmensching.com]
> Sent: Monday, January 07, 2013 11:31 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] how to deal with the service removal during
> upgrade and repair in WIX?
>
> That only defines a major upgrade. A minor upgrade is handled by
> recachine/repairing the MSI (msiexec /fv switch). A repair is just
> when the product is installed again and the REINSTALLMODE is set to
> something that would cause files to get written again.
>
> How are you handling the REINSTALLMODE?
>
>
> On Mon, Jan 7, 2013 at 11:23 AM, Wang, Zhongsheng <
> zhongsheng.w...@intel.com
> > wrote:
>
> > Rob,
> >
> > Here is how we handle Major and Minor upgrade. I don't even know how
> > to handle Repair so I think Repair is as default.
> >
> > <!-- upgrade definition -->
> > <Upgrade Id="$(var.UpgradeCode)"
> >         <UpgradeVersion
> >          Property="MAJORUPGRADE"
> >          Minimum="0.0.0.0"
> >          IncludeMinimum="yes"
> >          Maximum="$(var.ProductVersion)"
> >          IncludeMaximum="no"
> >          OnlyDetect="no"
> >          IgnoreRemoveFailure="no"
> >          MigrateFeatures="yes" />
> >
> > <!-- Detect for changes in 4th field only, not sure if this works-->
> >      <UpgradeVersion
> >            Property="MINORUPGRADE"
> >          Maximum="$(var.ProductVersion)"
> >          Minimum="$(var.ProductVersion)"
> >          IncludeMinimum="yes"
> >          IncludeMaximum="yes"
> >          OnlyDetect="yes" />
> > </Upgrade>
> >
> > Thanks,
> > zhong
> >
> > -----Original Message-----
> > From: Rob Mensching [mailto:r...@robmensching.com]
> > Sent: Monday, January 07, 2013 11:05 AM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] how to deal with the service removal during
> > upgrade and repair in WIX?
> >
> > Can you share how you are launching the Repair vs. Minor Upgrade vs.
> > Major Upgrade?
> >
> >
> > On Mon, Jan 7, 2013 at 10:34 AM, Wang, Zhongsheng <
> > zhongsheng.w...@intel.com
> > > wrote:
> >
> > > however, the behaviors of minor upgrade and repair are not the same.
> > > I hope there are some clarifications.
> > >
> > > My installer works with Repair but not with Minor Upgrade.
> > >
> > > With Repair, InstallInitialize is called once. With Minor Upgrade
> > > and Major Upgrade, InstallInitialize is called TWICE. Sometimes
> > > the condition to launch Uninstall_HIDDriver is evaluated to be
> > > false but true during other time.
> > >
> > > <InstallExecuteSequence>
> > >         <Custom Action="Uninstall_HIDDriver"
> > After="RemoveRegistryValues">
> > >         <![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR
>  MINORUPGRADE)]]>
> > >         </Custom>
> > > </InstallExecuteSequence>
> > >
> > > I do not know how to debug this situation. How to log some
> > > variables to the log file?
> > >
> > > Thanks,
> > > zhong
> > >
> > > -----Original Message-----
> > > From: Rob Mensching [mailto:r...@robmensching.com]
> > > Sent: Monday, January 07, 2013 10:14 AM
> > > To: General discussion for Windows Installer XML toolset.
> > > Subject: Re: [WiX-users] how to deal with the service removal
> > > during upgrade and repair in WIX?
> > >
> > > Minor upgrade is just a repair. It's a recache (stomp the MSI in
> > > your
> > > cache) then repair using that.  That's why I was saying you can't
> > > really tell the difference between (force) repair and minor upgrade.
> > >
> > >
> > > On Mon, Jan 7, 2013 at 10:05 AM, Wang, Zhongsheng <
> > > zhongsheng.w...@intel.com
> > > > wrote:
> > >
> > > > Thanks Neil and Rob for your comments.
> > > >
> > > > To uninstall a filter driver that is used by OS, reboot is
> > > > always required to remove the service. The solution here is NOT
> > > > to uninstall the filter driver during the maintenance mode
> > > > (repair, minor upgrade, and major
> > > > upgrade) in my opinion, but I don't know how in WIX.
> > > >
> > > > I am very familiar with InstallShield and know how to handle
> > > > that in InstallShield. But I am totally confused with WIX. In
> > > > InstallShield, there are global variables to tell me which
> > > > operation mode I am in so that I can customize the
> > > > installation/uninstallation action accordingly, but it is really
> > > > hard to do that in WIX. In the InstallExecuteSequence, how can I
> > > > know I am running in Repair, Minor Upgrade, Major Upgrade, Fresh
> > > > Install, or Remove or running from Add/Remove applet? I think
> > > > knowing the state of installer is very
> > > important for the installer to work properly and reliably.
> > > >
> > > >
> > > > When I tested my solution, it works for Repair. I am wondering
> > > > how to make the minor upgrade to behave like Repair.
> > > >
> > > > Thanks,
> > > > zhong
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Rob Mensching [mailto:r...@robmensching.com]
> > > > Sent: Monday, January 07, 2013 9:41 AM
> > > > To: General discussion for Windows Installer XML toolset.
> > > > Subject: Re: [WiX-users] how to deal with the service removal
> > > > during upgrade and repair in WIX?
> > > >
> > > > Zhong's scenario with a filter driver is probably harder to get
> > > > to shutdown than a typical windows service. I expect that's the
> > > > big
> > > difference.
> > > >
> > > > On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
> > > > <n...@x2systems.com>
> > > > wrote:
> > > >
> > > > > I don't think this is the issue, I only do major upgrades and
> > > > > the service stops just fine.
> > > > >
> > > > > I think there is some timing issue between stopping the
> > > > > service and windows installer or SCM removing them and
> > > > > consequently the service is marked as deleted in the registry
> > > > > and not removed until a
> > reboot.
> > > > > The restart manager doesn't detect that it is deleted and so
> > > > > the installer just fails when it tries to add the service.
> > > > >
> > > > > I am not sure how you can condition it as the ServiceInstall
> > > > > has to be in the same component as the service you are installing.
> > > > >
> > > > > Neil
> > > > >
> > > > > -----Original Message-----
> > > > > From: Rob Mensching [mailto:r...@robmensching.com]
> > > > > Sent: 07 January 2013 14:32
> > > > > To: General discussion for Windows Installer XML toolset.
> > > > > Subject: Re: [WiX-users] how to deal with the service removal
> > > > > during upgrade and repair in WIX?
> > > > >
> > > > > If you can't get the service to stop in time then you do need
> > > > > to do restart avoidance.
> > > > >
> > > > > Unfortunately, in an minor upgrade, I cannot think of anything
> > > > > set natively by the Windows Installer that will tell you you
> > > > > are in a minor upgrade.
> > > > > Minor upgrades are basically just a recache/reinstall so if
> > > > > you assume that the recache/reinstall is a minor upgraded
> > > > > you'll be wrong when it actually is just a recache/reinstall.
> > > > > However, thinking about this more you may not need to do
> > > > > anything in minor upgrade since a restart is required at the
> > > > > end of the install and there is only one MSI
> > > > installed.
> > > > >
> > > > > Major upgrade is easy since you have the UPGRADINGPRODUCTCODE
> > > > > in the MSI to condition actions in the old MSI. Of course, you
> > > > > have to ship your first version correctly for this to work.
> > > > > <smile/>
> > > > >
> > > > >
> > > > > On Sun, Jan 6, 2013 at 2:58 AM, Neil Sleightholm
> > > > > <n...@x2systems.com>
> > > > > wrote:
> > > > >
> > > > > > I find this usually happens when the service doesn't
> > > > > > shutdown in a timely manner. In my experience the stop
> > > > > > service control in Windows Installer is a bit temperamental
> > > > > > especially if you have more than one service to stop (I have
> > > > > > often resorted to using a custom action to run "net stop").
> > > > > > It also makes a difference where you schedule the remove
> > > > > > existing products and I have had more luck with scheduling
> > > > > > after InstallExecute (probably because it isn't removing
> > > > the service).
> > > > > >
> > > > > > (In my latest install I have found the most reliable option
> > > > > > is to do all the application and service stops in a separate
> > > > > > install.)
> > > > > >
> > > > > > Neil
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Wang, Zhongsheng [mailto:zhongsheng.w...@intel.com]
> > > > > > Sent: 05 January 2013 23:56
> > > > > > To: wix-users@lists.sourceforge.net
> > > > > > Subject: [WiX-users] how to deal with the service removal
> > > > > > during upgrade and repair in WIX?
> > > > > >
> > > > > > I am looking for some advice on how to deal with the service
> > > > > > removal during upgrade (major and minor) and repair. Since
> > > > > > OS will mark the service for deletion when the service is
> > > > > > removed and reboot is required, any future service update
> > > > > > during the installation process will be ignored. This leaves
> > > > > > the service not installed after repair or
> > > > > upgrade.
> > > > > >
> > > > > > What I want is that the service will NOT be removed during
> > > > > > upgrade and repair but removed during uninstallation (Remove
> > option).
> > > > > >
> > > > > > Here are some code snippet I am used to handle this, but it
> > > > > > does not work reliably. I hope somebody can give me some
> > > > > > advice on this
> > > topic.
> > > > > > Your help will be highly appreciated. The code seems to work
> > > > > > for Repair and Major Upgrade, but does not work well with
> > > > > > the minor upgrade where only the 4th field of the revision
> > > > > > is
> different.
> > > > > >
> > > > > > <!-- upgrade definition -->
> > > > > >     <Upgrade Id="$(var.UpgradeCode)"
> > > > > > <UpgradeVersion
> > > > > >         Property="MAJORUPGRADE"
> > > > > >         Minimum="0.0.0.0"
> > > > > >         IncludeMinimum="yes"
> > > > > >         Maximum="$(var.ProductVersion)"
> > > > > >         IncludeMaximum="no"
> > > > > >         OnlyDetect="no"
> > > > > >         IgnoreRemoveFailure="no"
> > > > > >         MigrateFeatures="yes" />
> > > > > >
> > > > > >       <!-- Detect for changes in 4th field only -->
> > > > > >       <UpgradeVersion
> > > > > > Property="MINORUPGRADE"
> > > > > >               Maximum="$(var.ProductVersion)"
> > > > > > Minimum="$(var.ProductVersion)"
> > > > > >               IncludeMinimum="yes"
> > > > > > IncludeMaximum="yes"
> > > > > > OnlyDetect="yes" />
> > > > > >     </Upgrade>
> > > > > >
> > > > > > <!-- Execution sequence -->
> > > > > > <InstallExecuteSequence>
> > > > > >       <Custom Action="Uninstall_HIDDriver"
> > > > After="RemoveRegistryValues">
> > > > > >         <![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR
> > > > > > MINORUPGRADE)]]></Custom> </InstallExecuteSequence>
> > > > > >
> > > > > > So what could be wrong?
> > > > > >
> > > > > > Thanks,
> > > > > > zhong
> > > > > >
> > > > > >
> > > > > > ------------------------------------------------------------
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > > > Keep your skills current with LearnDevNow - 3,200
> > > > > > step-by-step video tutorials by Microsoft MVPs and experts.
> > > > > > SALE $99.99 this month only -- learn more at:
> > > > > > http://p.sf.net/sfu/learnmore_122912
> > > > > > _______________________________________________
> > > > > > WiX-users mailing list
> > > > > > WiX-users@lists.sourceforge.net
> > > > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > > > >
> > > > > >
> > > > > > ------------------------------------------------------------
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > --
> > > > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > > > Keep your skills current with LearnDevNow - 3,200
> > > > > > step-by-step video tutorials by Microsoft MVPs and experts.
> > > > > > ON SALE this month only
> > > > > > -- learn more
> > > > > > at:
> > > > > > http://p.sf.net/sfu/learnmore_123012
> > > > > > _______________________________________________
> > > > > > WiX-users mailing list
> > > > > > WiX-users@lists.sourceforge.net
> > > > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > > > >
> > > > >
> > > > > --------------------------------------------------------------
> > > > > --
> > > > > --
> > > > > --
> > > > > --
> > > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > > Keep your skills current with LearnDevNow - 3,200 step-by-step
> > > > > video tutorials by Microsoft MVPs and experts. SALE $99.99
> > > > > this month only -- learn more at:
> > > > > http://p.sf.net/sfu/learnmore_122412
> > > > > _______________________________________________
> > > > > WiX-users mailing list
> > > > > WiX-users@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > > >
> > > > >
> > > > > --------------------------------------------------------------
> > > > > --
> > > > > --
> > > > > --
> > > > > --
> > > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > > Keep your skills current with LearnDevNow - 3,200 step-by-step
> > > > > video tutorials by Microsoft MVPs and experts. SALE $99.99
> > > > > this month only -- learn more at:
> > > > > http://p.sf.net/sfu/learnmore_122412
> > > > > _______________________________________________
> > > > > WiX-users mailing list
> > > > > WiX-users@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > > >
> > > >
> > > > ----------------------------------------------------------------
> > > > --
> > > > --
> > > > --
> > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > Keep your skills current with LearnDevNow - 3,200 step-by-step
> > > > video tutorials by Microsoft MVPs and experts. SALE $99.99 this
> > > > month only -- learn more at:
> > > > http://p.sf.net/sfu/learnmore_122412
> > > > _______________________________________________
> > > > WiX-users mailing list
> > > > WiX-users@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > >
> > > >
> > > > ----------------------------------------------------------------
> > > > --
> > > > --
> > > > --
> > > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> > > > 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more.
> > > > Keep your skills current with LearnDevNow - 3,200 step-by-step
> > > > video tutorials by Microsoft MVPs and experts. SALE $99.99 this
> > > > month only -- learn more at:
> > > > http://p.sf.net/sfu/learnmore_122412
> > > > _______________________________________________
> > > > WiX-users mailing list
> > > > WiX-users@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > --
> > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> > > HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep
> > > your skills current with LearnDevNow - 3,200 step-by-step video
> > > tutorials by Microsoft MVPs and experts. SALE $99.99 this month
> > > only -- learn more at:
> > > http://p.sf.net/sfu/learnmore_122412
> > > _______________________________________________
> > > WiX-users mailing list
> > > WiX-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > --
> > > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> > > HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep
> > > your skills current with LearnDevNow - 3,200 step-by-step video
> > > tutorials by Microsoft MVPs and experts. SALE $99.99 this month
> > > only -- learn more at:
> > > http://p.sf.net/sfu/learnmore_122412
> > > _______________________________________________
> > > WiX-users mailing list
> > > WiX-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> >
> > --------------------------------------------------------------------
> > --
> > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> > HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your
> > skills current with LearnDevNow - 3,200 step-by-step video tutorials
> > by Microsoft MVPs and experts. SALE $99.99 this month only -- learn
> > more at:
> > http://p.sf.net/sfu/learnmore_122412
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> > --------------------------------------------------------------------
> > --
> > -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> > HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your
> > skills current with LearnDevNow - 3,200 step-by-step video tutorials
> > by Microsoft MVPs and experts. SALE $99.99 this month only -- learn
> > more at:
> > http://p.sf.net/sfu/learnmore_122412
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
> ----------------------------------------------------------------------
> -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your
> skills current with LearnDevNow - 3,200 step-by-step video tutorials
> by Microsoft MVPs and experts. SALE $99.99 this month only -- learn
> more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ----------------------------------------------------------------------
> -------- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your
> skills current with LearnDevNow - 3,200 step-by-step video tutorials
> by Microsoft MVPs and experts. SALE $99.99 this month only -- learn
> more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, 
Windows 8 Apps, JavaScript and much more. Keep your skills current with 
LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. 
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to