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.
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.
Post by Neil SleightholmI 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-----
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/>
Post by Neil SleightholmI 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-----
Sent: 05 January 2013 23:56
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.
Post by Neil SleightholmWhat 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
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
WiX-users mailing list
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
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
WiX-users mailing list
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users