Discussion:
[WiX-users] how to deal with the service removal during upgrade and repair in WIX?
Wang, Zhongsheng
2013-01-05 23:55:47 UTC
Permalink
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
Rob Mensching
2013-01-06 00:26:23 UTC
Permalink
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
Post by Wang, Zhongsheng
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
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-06 02:24:29 UTC
Permalink
Some service cannot be removed immediately. On Windows, a device driver is listed as a service too. For example, a filter driver service that is currently used by the hardware cannot be removed immediately without a reboot. This is the situation I would like to handle.

Thanks,
zhong

-----Original Message-----
From: Rob Mensching [mailto:***@robmensching.com]
Sent: Saturday, January 05, 2013 4:26 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?

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
Post by Wang, Zhongsheng
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
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm
2013-01-06 10:58:06 UTC
Permalink
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:***@intel.com]
Sent: 05 January 2013 23:56
To: wix-***@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
Rob Mensching
2013-01-07 14:32:26 UTC
Permalink
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 Sleightholm
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-----
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.
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
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
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm
2013-01-07 17:00:55 UTC
Permalink
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:***@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/>
Post by Neil Sleightholm
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-----
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.
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
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
Rob Mensching
2013-01-07 17:41:13 UTC
Permalink
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 Sleightholm
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-----
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 Sleightholm
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-----
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 Sleightholm
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
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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-07 18:05:34 UTC
Permalink
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:***@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.
Post by Neil Sleightholm
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-----
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 Sleightholm
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-----
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 Sleightholm
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
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
Rob Mensching
2013-01-07 18:14:29 UTC
Permalink
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Neil Sleightholm
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-----
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.
Post by Neil Sleightholm
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 Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
------------------------------------------------------------------------------
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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-07 18:34:14 UTC
Permalink
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:***@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.
Post by Wang, Zhongsheng
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-----
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.
Post by Neil Sleightholm
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-----
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
----------------------------------------------------------------------
-------- 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
Rob Mensching
2013-01-07 19:04:55 UTC
Permalink
Can you share how you are launching the Repair vs. Minor Upgrade vs. Major
Upgrade?
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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-----
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
----------------------------------------------------------------------
-------- 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
------------------------------------------------------------------------------
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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-07 19:23:50 UTC
Permalink
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:***@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?
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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-----
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
Rob Mensching
2013-01-07 19:31:13 UTC
Permalink
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?
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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">
Post by Wang, Zhongsheng
<![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-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
What I want is that the service will NOT be removed during
upgrade and repair but removed during uninstallation (Remove
option).
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-07 19:51:03 UTC
Permalink
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:***@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?
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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">
Post by Wang, Zhongsheng
<![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-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
What I want is that the service will NOT be removed during
upgrade and repair but removed during uninstallation (Remove
option).
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
Rob Mensching
2013-01-07 20:01:15 UTC
Permalink
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.
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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">
Post by Wang, Zhongsheng
<![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR
MINORUPGRADE)]]>
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
</Custom>
</InstallExecuteSequence>
I do not know how to debug this situation. How to log some variables
to the log file?
Thanks,
zhong
-----Original Message-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
What I want is that the service will NOT be removed during
upgrade and repair but removed during uninstallation (Remove
option).
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
<!-- 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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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
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
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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Wang, Zhongsheng
2013-01-07 20:18:52 UTC
Permalink
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:***@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.
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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">
Post by Wang, Zhongsheng
<![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR
MINORUPGRADE)]]>
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
</Custom>
</InstallExecuteSequence>
I do not know how to debug this situation. How to log some
variables to the log file?
Thanks,
zhong
-----Original Message-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
What I want is that the service will NOT be removed during
upgrade and repair but removed during uninstallation (Remove
option).
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
<!-- 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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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.
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
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
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
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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
Rob Mensching
2013-01-07 20:28:58 UTC
Permalink
The default command-line would be "msiexec /i your.msi"

Those properties are documented in the MSI SDK. I'd suggest starting there.
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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-----
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 <
Post by Wang, Zhongsheng
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">
Post by Wang, Zhongsheng
<![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR
MINORUPGRADE)]]>
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
</Custom>
</InstallExecuteSequence>
I do not know how to debug this situation. How to log some
variables to the log file?
Thanks,
zhong
-----Original Message-----
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 <
Post by Wang, Zhongsheng
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.
Post by Wang, Zhongsheng
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-----
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.
Post by Wang, Zhongsheng
On Mon, Jan 7, 2013 at 9:00 AM, Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
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.
Post by Neil Sleightholm
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
Post by Neil Sleightholm
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).
Post by Neil Sleightholm
Post by Neil Sleightholm
(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 Sleightholm
What I want is that the service will NOT be removed during
upgrade and repair but removed during uninstallation (Remove
option).
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
<!-- 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">
Post by Neil Sleightholm
Post by Neil Sleightholm
<![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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
Keep your skills current with LearnDevNow - 3,200
step-by-step video tutorials by Microsoft MVPs and experts.
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.
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Wang, Zhongsheng
Post by Neil Sleightholm
Post by Neil Sleightholm
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
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
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
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
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
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
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
--------------------------------------------------------------------
--
-------- 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
----------------------------------------------------------------------
-------- 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
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
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Bruce Cran
2013-03-16 13:44:24 UTC
Permalink
Post by Wang, Zhongsheng
<InstallExecuteSequence>
<Custom Action="Uninstall_HIDDriver" After="RemoveRegistryValues">
<![CDATA[REMOVE="ALL" AND NOT (MAJORUPGRADE OR MINORUPGRADE)]]>
</Custom>
</InstallExecuteSequence>
Unless you're setting those yourself, MAJORUPGRADE and MINORUPGRADE
won't exist - they're not standard properties. I think you'll want to
use 'UPGRADINGPRODUCTCODE' instead.
e.g. <![CDATA[REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE]]>

http://stackoverflow.com/questions/320921/how-to-add-a-wix-custom-action-that-happens-only-on-uninstall-via-msi
--
Bruce Cran
Loading...