The service should *usually* deleted right away. In my experience, if the service isn't removed immediately that means that the service is not shutting down cleanly or there is some other process on the machine that has a handle locked on the SCM. The restart causes all the handles to get cleaned up and that works around the problem.
The root issue is usually something on the machine. On Sat, Jan 5, 2013 at 3:55 PM, Wang, Zhongsheng <zhongsheng.w...@intel.com>wrote: > 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