Avatar of at999
at999
 asked on

create installer and uninstaller both for C# .net project

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
.NET Programming

Avatar of undefined
Last Comment
at999

8/22/2022 - Mon
SOLUTION
Jacques Bourgeois (James Burger)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
markmiddlemist

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
at999

ASKER
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}
at999

ASKER
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..
markmiddlemist

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
at999

ASKER
is there any risk in changing the version on my class library...
at999

ASKER
will it change the GUID of my DLL if I change the version number? Thanks
markmiddlemist

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
at999

ASKER
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}
at999

ASKER
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
markmiddlemist

That value is safe then, unless you actually go in and explicity change it yourself
Your help has saved me hundreds of hours of internet surfing.
fblack61
at999

ASKER
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")]