Solved

create installer and uninstaller both for C# .net project

Posted on 2012-03-11
12
674 Views
Last Modified: 2012-06-27
i have visual studio 2010

i have created a .net project C#.net which produces a simple DLL...Its on .net framework 3.5

Now, i created a setup project to install that DLL on users machine.
I can do a silent installation on my/users machien by running -
setup.exe -quiet

Now, I might have to make changes to my DLL and upgrade that DLL on users machines for many times...
I donot want to go to users machine and uninstall my dll using add-remove programs each time I upgrade my DLL...

How can i create an uninstaller for that DLL? So that i can run a command and it will do a silent uninstall of that DLL ? thansk a lot...  

pl help
0
Comment
Question by:at999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
12 Comments
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 150 total points
ID: 37708715
.NET dlls are not registered as COM dlls are. You can simply delete the file.

Have the installer for your new version look for an older version and delete it.
0
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 350 total points
ID: 37709490
Working on the assumption you're using a standard visual studio setup project, select the setup project in solution explorer then go to the properties grid (press F4), then set
RemovePreviousVersions to true

This means that newer versions of files overwrite existing ones  - http://msdn.microsoft.com/en-us/library/y63fxdw6(v=vs.90).aspx for more details
0
 

Author Comment

by:at999
ID: 37711261
I tried setting - "RemovePreviousVersions" to true, but it does not re-install it....
So if I do this-
setup.exe -quiet -l mylogfile.txt

Log file - shows this message


MSI (s) (EC:24) [14:01:44:541]: Product: MyProduct-- Configuration failed.

MSI (s) (EC:24) [14:01:44:541]: Windows Installer reconfigured the product. Product Name: MyProduct. Product Version: 1.0.0. Product Language: 1033. Manufacturer: MyCompany. Reconfiguration success or error status: 1638.

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
{A61D2D77-A974-46F5-9DB3-DE8358C1C4ED}
0
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

Author Comment

by:at999
ID: 37711516
I tried changing version number in the setup-project did a silent upgrade/install

However, it did not update my actual DLL, it just updated the TLB file..
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37712624
gi in to the assembly properties on your class library project and change the version number there - it will only overwrite files where it recognises the version in the instaler is newer.
0
 

Author Comment

by:at999
ID: 37714764
is there any risk in changing the version on my class library...
0
 

Author Comment

by:at999
ID: 37714767
will it change the GUID of my DLL if I change the version number? Thanks
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37715078
It will need to change the version number of the DLL in order for it to upgrade it.

As for the GUID, do you mean for COM exposure? If so then no it won't change that.
0
 

Author Comment

by:at999
ID: 37715153
no by GUID I mean the GUID mentioned just below the namespace of my DLL -

namespace MyDLLNamespace
{
    [Guid("527aee8e-d3f8-4a99-8fe4-6064c7697637")]
}

That guid is in the registry too under these locations -

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MyDLLNamespace.MyDLLClass\CLSID

 
HKEY_CLASSES_ROOT\MyDLLNamespace.MyDLLClass\CLSID


HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{527aee8e-d3f8-4a99-8fe4-6064c7697637}
0
 

Author Comment

by:at999
ID: 37715219
Also I see registry entry in this -
HKEY_CURRENT_USER\Software\MySoftwareWhichwilluseDLL\DockingPaneLayouts\panestate\Pane-19\

I think mysoftwarewhichwillusedll is using COM to use the dll
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37715266
That value is safe then, unless you actually go in and explicity change it yourself
0
 

Author Comment

by:at999
ID: 37715419
OK Thanks...

You mentioned -
gi in to the assembly properties on your class library project and change the version number there - it will only overwrite files where it recognises the version in the instaler is newer.

Do i have to change the AssemblyInfo.cs in the project of mydll?
as below -
 // Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question