473,652 Members | 3,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

installer woes (MSI generated by VS.NET 2003)

I'm having some inconsistency problems with my deployment project ("Setup")
and its custom actions ("Installer" ). I'm using Visual Studio .NET 2003
(.NET 1.1, no service pack) on Windows XPSP1.

My main project is a band object (Explorer Bar) in an assembly (.DLL) that
needs to be registered on installation and unregisted on uninstallation. In
addition, during installation, Setup creates registry subkeys, sets registry
values, installs some application files, and adds a new file-type. On
uninstallation, Setup is supposed to undo all of that. More specifically, I
have custom actions for Setup that are run within the Installer class. The
Installer class is within the main assembly, and perhaps surprisingly, that
seems to work, some of the time. I have also tried putting the Installer
class in its own assembly, both as a class library and as a console
application, and that doesn't seem to work any better than having the
Installer class in the main assembly. Sometimes the registration or
unregistration of the main assembly fails. The workaround we tell our users
(a small userbase so far, fortunately) is to "repair" after installation, or
to uninstall completely before installing a new version. Neither are as
ideal as being able to simply install over the previous version. I think
there are two subproblems.

1) The Uninstall custom action in the Installer class isn't always called.
This is especially inconsistent. My Installer class overrides
OnBeforeUninsta ll() [so that the main assembly is unregistered before the
files are removed] and Uninstall() [so that savedState is empty, in order
for the installState to be removed]. Lacking better debugging tools for
MSIs, I added code in these methods to set registry entries containing the
timestamp at the beginning and end of each of these methods. I verified
that usually the Uninstall custom action is (but not always) called when the
user explicitly asks to remove the package (via "Add/Remove Programs"), but
when the user is installing over a previous version, sometimes (but not
always) the Uninstall custom action is called. As a side note, I change the
installer version, PackageCode, and ProductCode whenever I build a new
installer. I don't understand why these inconsistencies occur. For a while
I thought VS.NET might randomly corrupt the Setup.vdproj file and that I'd
have to remove and add the custom actions again, in order to be sure that
the Uninstall custom action was registered, and once or twice I built the
Setup.vdproj file from scratch, fearing general corruption in the file. This
seemed to help (especially the latter), but not for too long, and it's not a
sustainable solution, even if it's not a placebo. In addition, which may or
may not be related, the Setup.MSI doesn't seem to always uninstall all
registry entries, and because of that, I've had to add a few lines to my
Uninstall custom action. It doesn't seem right to me that the MSI would
sometimes not uninstall registry entries that it added in the first place.

2) The second subproblem is more specific to my project, and this occurs
sometimes when I'm registering the main assembly. The main assembly is
registered in the overridden OnCommitted() method of the Installer class,
presumably after the previous version's main assembly was unregistered in
the OnBeforeUninsta ll() method. In the case where the previous version and
the new version were installed in the same "Program Files" folder, the
assembly containing the Installer class will have the same exact CodeBase,
but they'll of course have a different FullName because the assembly version
has been automatically incremented. It seems that sometimes the Commit
custom action will re-register the old assembly instead of registering the
new assembly. My registration code looks like this:
RegistrationSer vices rs = new RegistrationSer vices();
rs.RegisterAsse mbly(MyAssembly , AssemblyRegistr ationFlags.SetC odeBase);
and my unregistration code looks like this:
RegistrationSer vices rs = new RegistrationSer vices();
rs.UnregisterAs sembly(MyAssemb ly);
MyAssembly is defined as a property:
Assembly MyAssembly
{
get
{
return Assembly.LoadFi le(InstallDirec tory + "assembly.dll") ;
}
}
I used to use Assembly.Load(p ath) instead, but it seemed that
Assembly.LoadFi le(path) worked better. My concern is that either the
Uninstall and Commit custom actions share an AppDomain, so sometimes
MyAssembly might return the previous assembly during the Commit phase if the
previous assembly wasn't somehow still in Commit's AppDomain after Uninstall
finished. I tried creating a temporary AppDomain and then loading the
assemblies within that, but it threw a deserialization exception. I suppose
the overall issue of this subproblem is that I'm trying to register and
unregister assemblies without knowing the FullName of either assembly, as
I'm trying to semi-automate the build process and stay within VS.NET as much
as possible (for now).

I know these are complex and possibly peculiar problems! While I'd love for
someone to post a solution for either (or both!) subproblems, at the very
least, I'd appreciate hearing tips regarding debugging deployment projects
and custom installation classes, similar stories of installer woes and
solutions, and recommendations for possibly better installation/deployment
tools than VS.NET's deployment projects. Something like InstallShield seems
like overkill, but maybe it's what I need to have dependable installations.

Thanks for reading this far!
Arun
Jul 21 '05 #1
0 2090

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
9412
by: Luke Wright | last post by:
Hi, I have built a setup project to install an application I am developing. I would like to be able to prompt the user whether to install Shortcuts in the following locations: * Start Menu * Desktop * Quick Launch I have added a UI page that has three checkboxes on it to
4
7405
by: Bill Murray | last post by:
I am using VS.NET 2003 and trying to deploy a service program(c++) to a Windows 2000 Server system. I have also written a small DLL (USSsetup.dll) that is used to start/stop the service using a custom action. This dll is apparently dependent on the MSVCP71.DLL and MSVCR71.DLL's as per the Detected Dependencies folder visible in the deployment project All this good except I am UNABLE to Retarget the output of the msm merge...
5
4910
by: Arun Bhalla | last post by:
I'm working with VS.NET 2003 and .NET 1.1 (not SP1) on Windows XP SP1. My application is using the Windows Installer Bootstrap. (I may have also installed a module which detects requirements (.NET 1.1 -> MsiNetAssembly Support.) I have a few issues and questions regarding the MSI and its properties. * This may be my biggest annoyance at the moment. When the installer creates the target directory, it's setting them as read-only. When the...
4
6607
by: db_from_mn | last post by:
Using Visual Studio, 2003: When I create a deployment project and try to install it, I get Installer Error 2705: Invalid Table, Could not be linked as tree. How can I debug this? It seems that I should view the .msi file, but I don't know how. My Solution has several dlls in its hierarchy. Can someone help me out? Thanks, Dennis
2
5867
by: Lauren Wilson | last post by:
Hi folks, I am confused about how to create a stand alone installer to install Access 2003 Runtime. There are two files I have compiled into a self-extracting zip file: ACCESSRT.CAB ACCESSRT.MSI Of course, if the user extracts the files and then double clicks on
0
382
by: Arun Bhalla | last post by:
I'm having some inconsistency problems with my deployment project ("Setup") and its custom actions ("Installer"). I'm using Visual Studio .NET 2003 (.NET 1.1, no service pack) on Windows XPSP1. My main project is a band object (Explorer Bar) in an assembly (.DLL) that needs to be registered on installation and unregisted on uninstallation. In addition, during installation, Setup creates registry subkeys, sets registry values, installs...
10
6101
by: Lauren Wilson | last post by:
I have a desperate short term need for a way to install Access 2003 runtime on client computers. I have the proper license to do so but I cannot seem to find the files to do it like we did with the old Access 2000 Runtime. Also, I cannot use the MS Package & Deployment wizard because it won't allow us to install our app into the specific path that it must be in. It only seems to allow preset macros to define the target install path --...
3
8945
by: david | last post by:
Greetings, I'm doing some modifications of an existing Visual Studio .NET 2003 C# project that is to be deployed as a windows service. The solution includes a project that builds an MSI file. Over the month I've been working on the project, I've built the MSI file many times. Sometimes it runs fine and I have a service that can be started and stopped. Other times, the MSI file starts up, goes through several screens and then reports...
1
1500
by: MimiMi | last post by:
I have a deployment project that was originally created in VS2003. Since I don't have VS2003, I now open it in VS2005, but then of course VS2005 has to convert it. Everything seems to work fine. I build the project and an installer.msi - file as well as a setup.exe - file is created. Now to the problem: double-clicking the setup.exe doesn't work! It gives me the error "An error occured while downloading a required file. You may retry...
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.