C# .NET - uninstall older version automatically

Asked By Dilip Sharma
10-Feb-12 08:58 AM
hi i am using vs 2008

i create a setup of my C# application ...

its running fine...

but if i make any changes and create setup once again ...
then how can i uninstall my older application and install new one by running setup...


Please suggest me...

  Suchit shah replied to Dilip Sharma
10-Feb-12 09:59 AM
That thing you need to manage when you are creating the setup at that time there is some option for that and you can also manage it through registry entry. so install time you need to check that registry entry if the entry is found then you can remove that version and then install new one 
  dipa ahuja replied to Dilip Sharma
10-Feb-12 10:26 AM
The setup is installed in the same directory, when you install new version it may replace the older one
  kalpana aparnathi replied to Dilip Sharma
10-Feb-12 01:32 PM
hi,

You should be able to read the uninstall string from the registry, given the AppId (i.e. the value you used for AppID in the [Setup]-section). It could be found under Software\Microsoft\Windows\CurrentVersion\Uninstall\{AppId}\ (could be either HKLM or HKCU, so best check both) where {AppId} should be substituted with the actual value you used. Look for the UninstallString or QuietUninstallString values and use the Exec function to run it from your InitializeSetup() event function.


and
removed non-working alternative solution using a [Run]-section entry with {uninstallexe}


Thanks,

Create New Account
help
uninstall hi, How i uninstall c# windows application programatically. Thanks in advance. You can try this code sample uninstall application melodramatically. Microsoft.Win32.RegistryKey Fregistry = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE") .OpenSubKey("Microsoft").OpenSubKey("Windows Installer").OpenSubKey("UserData") .OpenSubKey("S-1-5-18").OpenSubKey("Products"); string []Names = Fregistry.GetSubKeyNames() ; string uninstall = ""; string ApplicationName = "Adobe Reader 7.0.8"; for (int i = 0; i < Names.Length; i InstallProperties"); if (FTemp.GetValue("DisplayName").ToString() = = ApplicationName) { object obj = FTemp.GetValue("UninstallString"); if (obj = = null) uninstall = ""; else uninstall = obj.ToString(); i = Names.Length; } } System.Console.WriteLine(uninstall); System.Diagnostics.Process FProcess
Change BIOS using C / C++? C++ / VB Dear All, Is it possible to change BIOS using a C / C++ programm? For example I must activate Hyperthreading in BIOS for all machine. It would be running program)? Thanks What do you mean by "for all machine"? If you release an application that tries to turn on hyperthreading on MY machine, I'll uninstall the application and sue your company. It's not YOUR job to reconfigure MY computer. - - Tim Roberts
Set up project uninstall C# .NET Framework I have created set up and deployment project for my C# application and installed it in a machine.When i uninstall the same the log files and other temporary files created during application run is not getting deleted.Please suggest C# Discussions Application (1) Deleted.Please (1) Isntaller (1) Where are you creating these files? A program should
com%2fdownload%2f2%2f6%2fa%2f26a7161c-44c8-4cef-b4bb-249ed87e6599%2foffice2003-KB936677-FullFile-ENU.exe 2. Create a folder in the c: \ named Patch. Place office2003-KB936677-FullFile-ENU.exe in that folder. 3. goto start, then type "cd patch" (without the quotes). hit enter 5. type "office2003-KB936677-FullFile-ENU.exe / c / t:c: \ patch / q" (without the quotes). hit enter 6. type "msiexec / p OUTLFLTR.msp / l*v c: \ patch \ Log.txt / qb" (without the quotes). hit enter 7. It will fail or not Either way please locate the file c: \ patch \ Log.txt and paste the contents here. You may need to break it up 09 / 2007 23:43:50 Build type: SHIP UNICODE 3.01.4000.4039 Calling process: C: \ WINDOWS \ system32 \ msiexec.exe = = = MSI (c) (2C:F4) [23:43:50:122]: Resetting cached policy values MSI (c) (2C:F4) [23:43:50:122]: Machine policy value 'Debug' is 0 MSI (c) (2C
MCP] | anders AT contoso.se | http: / / www.contoso.se [ENG] Part 2 of log: MSI (c) (58:94) [10:42:35:468]: Skipping action: _Set_MOMX_PRODUCT_FOUND_ExpressSameVersion (condition is false) MSI (c) (58:94) [10:42:35:468]: Skipping action: _Set_MOMX_PRODUCT_FOUND_EvalSameVersion (condition is false) MSI (c) (58:94) [10:42:35:468]: Skipping action: _AbortDowngradeProductAttempt (condition is false) MSI c) (58:94) [10:42:35:468]: Skipping action: _AbortInvalidUpgradeProductAttempt (condition is false) MSI (c) (58:94) [10:42:35:468]: Skipping action: _AbortIncompatibleAgent (condition is false) MSI (c) (58:94) [10:42:35:468]: Skipping action: CCPSearch (condition is false) MSI (c) (58:94) [10:42:35:468]: Skipping action: RMCCPSearch (condition is false) MSI c) (58:94) [10:42:35:468]: Doing action: CostInitialize Action 10:42:35: CostInitialize. Determining