Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WinForm app UNinstall involving VC++ runtime libs takes a long tim

113 views
Skip to first unread message

Clift Norris

unread,
Sep 21, 2007, 3:46:04 PM9/21/07
to
I have a simple C# WinForm app that I'm installing via a setup project built
in VisualStudio.net2005. The solution also builds a managed C++/CLI assembly
that is included in the setup kit.
Since the C++ runtime SxS libraries are required, I'm including the merge
modules Microsoft_VC80_CRT_x86.msm and policy_8_0_Microsoft_VC80_CRT_x86.msm
in the setup kit.
The installer works fine and the application runs fine once installed.

Here is the problem:
When the application is UNinstalled, the operation takes a very long time to
complete (5 to 8 minutes). This seems to be the case whether the SxS runtime
libraries were previously existing on the target machine or not. If I omit
the merge modules from the setup kit, the uninstall occurs in a reasonable
amount of time (about 10 to 15 seconds).
I turned on MSI logging and saw that there were many thousands of lines in
the log file that resembled this:

1: sxsdelca 2: traceop 3: 748 4: 0
MSI (s) (04!B0) [14:33:22:793]: Creating MSIHANDLE (195551) of type 790531
for thread 6064
1: scavenge 2: {5F1788B3-C9CE-4BAD-8293-3B622DA643D1} 3:
{8B2BADB7-936A-6F8A-C01F-C8B3B9A1E18E} 4:
{7C01D6E5-350C-40E5-A6C8-91812D6629DE} 5: -1
MSI (s) (04!B0) [14:33:22:793]: Closing MSIHANDLE (195551) of type 790531
for thread 6064
1: sxsdelca 2: traceop 3: 748 4: 0
MSI (s) (04!B0) [14:33:22:793]: Creating MSIHANDLE (195552) of type 790531
for thread 6064
1: scavenge 2: {B49F0D85-3C57-4C0F-82E4-BA39984AE84C} 3:
{8B2BADB7-936A-6F8A-C01F-C8B3B9A1E18E} 4:
{7C01D6E5-350C-40E5-A6C8-91812D6629DE} 5: -1
MSI (s) (04!B0) [14:33:22:809]: Closing MSIHANDLE (195552) of type 790531
for thread 6064

Does anyone have any idea why this long time is required to UNinstall? How
can I make the uninstall happen in a reasonable amount of time?

-Clift

Linda Liu [MSFT]

unread,
Sep 24, 2007, 4:17:26 AM9/24/07
to
Hi Clift,

> When the application is UNinstalled, the operation takes a very long time
to complete (5 to 8 minutes).

It seems that the installer hangs during the uninstall.

I performed a test based on your description but didn't reproduce the
problem on my side. I create a Setup project and only add the
'Microsoft_VC80_CRT_x86.msm' and the
'policy_8_0_Microsoft_VC80_CRT_x86.msm' merge modules into the Setup
project.

Then I install and uninstall the resulted MSI package. It only takes 15 to
20 seconds to uninstall the MSI package.

I suggest that you create a new Setup project and only add the two merge
modules into the Setup project to see if the problem still exists.

In addition, you can also have a try removing the 'SxsUninstallCA' custom
action from the InstallExecuteSequence table of the MSI package, so that
when you uninstall the MSI package, the VC++ runtime libs won't be
uninstalled.

To do this, open the MSI package with Orca, and navigate to the
InstallExecuteSequence table. Click the 'Sequence' column to sort the table
by sequence and remove the item 'SxsUninstallCA' which should be the last
record in the InstallExecuteSequence table.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Phil Wilson

unread,
Sep 24, 2007, 2:01:01 PM9/24/07
to
I've seen this too. The issue seems to be the SxsUninstall custom action.
It takes at least three minutes to go though all those steps as shown in
your log.
--
Phil Wilson
[MVP Windows Installer]

"Clift Norris" <Cl...@nospam.nospam> wrote in message
news:49BDAE3C-8519-4A54...@microsoft.com...

Clift Norris

unread,
Sep 25, 2007, 12:20:00 PM9/25/07
to
"Linda Liu [MSFT]" wrote:
> In addition, you can also have a try removing the 'SxsUninstallCA' custom
> action from the InstallExecuteSequence table of the MSI package, so that
> when you uninstall the MSI package, the VC++ runtime libs won't be
> uninstalled.
>
> To do this, open the MSI package with Orca, and navigate to the
> InstallExecuteSequence table. Click the 'Sequence' column to sort the table
> by sequence and remove the item 'SxsUninstallCA' which should be the last
> record in the InstallExecuteSequence table.
>

Linda,
Your suggestion worked fine for me. Thanks very much ! I removed the
SxSUninstallCA from my MSI file using Orca and then the long uninstall time
was reduced to 15 seconds. Leaving the SxS libs installed is acceptable to
me.

Additionally, I wrote a .js script to modify the MSI file and ran the script
as a PostBuild step in my Setup project. It all worked fine!


FYI, I'm sure the SxS merge modules were the cause of the long uninstalls,
since just the act of removing the merge modules from my Setup project
reduced the long uninstall times.

Thanks again for your help!

Clift Norris

unread,
Sep 25, 2007, 12:34:00 PM9/25/07
to
If anyone else is interested, there is the NoSxS_uninstall.js file that I
used to modify the MSI file to prohibit the UNinstallation of the C++/CLI
Side-by-Side runtime libraries.

-Clift

====== begin code snippet =======

// This code alters its command-line argument (an MSI file)
// so that the C++/CLI runtime libraries (v8.1) mentioned
// in the MSI file, are NOT uninstalled.
// It assumes that the runtime libs entry has been added to the
// MSI file (as merge modules) previously by a VS.NET2005 Setup project.
//
// You should run this via cscript.exe to have the output go
// to the console,
// and via wscript.exe to output to msgboxes.
// Cscript.exe NoSxS_uninstall.js myMSIfile.msi

var msiOpenDatabaseModeTransact = 1;
var msiViewModifyReplace = 4


if (WScript.Arguments.Length != 1)
{
// Command-line arg should be the name of the MSI file to be modified.
WScript.StdErr.WriteLine("Usage:\n " + WScript.ScriptName + " MSIfile");
WScript.Quit(1);
}

var filespec = WScript.Arguments(0);
var installer = WScript.CreateObject("WindowsInstaller.Installer");
var database = installer.OpenDatabase(filespec,
msiOpenDatabaseModeTransact);

// Modify the Condition for the C++/CLI Side-by-Side runtime DLLs to that
// they are NEVER uninstalled:
var condition = "NEVER";

SetCondition("SxsUninstallCA", "InstallExecuteSequence", condition);

database.Commit();

WScript.Echo(WScript.ScriptFullName + ":\n" +" Removed SxS C++ libs
UNinstall from the MSI file: " + filespec);


// --------------------------------------------------------------
function SetCondition(action, table, condition)
{
var sql = "SELECT `Action`, `Condition`, `Sequence` FROM " + table + "
WHERE `Action`='" + action + "'";
var view = database.OpenView(sql);
view.Execute();
var record = view.Fetch();
record.StringData(2) = condition;
view.Modify(msiViewModifyReplace, record);
view.Close();
}

====== end code snippet ======

HookEm

unread,
Apr 23, 2009, 2:04:08 PM4/23/09
to
I reported this to Microsoft using my MSDN subscription. After finally being
routed to the correct resolvers they were able to determine that this is a
problem under the following conditions:

1) MSI package contains the SxsInstallCA/SxsUninstallCA custom actions from
the VS 2005 SP1 merge modules.
2) MSI package contains the [MsiLogging] property with the "x" logging flag
(debug) included in the value.
3) MSI 4.0 or higher is installed.

What is happening is that the CAs from the VS 2005 SP1 modules have some
code that gets fired when the "x" MSI logging flag is set. The code itself
doesn't actually write much to the MSI log but if the correct debugging
setting is enabled on the system and the appropriate debugging objects are
present it will show more information in the debugging window.

In order to prevent the uninstall from using [MsiLogging] value specified in
the MSI package, you have to BOTH of the MSI logging machine policy registry
entries listed below:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"DisableLoggingFromPackage"=dword:00000001

The "Logging" registry value can be set to anything as long as the "x" flag
is not specified. Also note that the MSI log will still show the
[MsiLogging] value specified in the MSI package but it will be ignored and
the value specified in the "Logging" registry value will be used instead.

Microsoft has promised me they will send me a URL for a support incident
that can be referenced by my customers. I will post the URL once it is
available.

Hope this helps!
--
Colby

HookEm

unread,
May 8, 2009, 3:21:01 PM5/8/09
to

Glen Lantz

unread,
Jul 20, 2009, 9:14:01 AM7/20/09
to
Hi,

I have the same problem - uninstallation involving VC++ runtime libs works
too slow (up to 10 minutes). I have tried to use the registry entries you
mentioned, but this did not help. Furthemore, the uninstallation works slow
even when logging is not used at all.

Are there ways to resolve the problem?
--
Thanx,
Glen

guoyf

unread,
Nov 29, 2009, 9:32:01 PM11/29/09
to
I have the same problem,I change the code of SxsUninstallCA, my code run fast.

0 new messages