3

I need my application to uninstall itself.

Reason: It's come to my attention that my app is destroying its own files (my bad), but the user of my app doesn't understand why he needs to uninstall it and refuses to uninstall it. However, he still complains about the constant problems. And in the Terms Of Use, there is a line that says "...we reserve the right to remove the application from your computer and temporarily or permanently discontinue your use of the software."

So, I did some searching on how to uninstall a program, (which will be replaced by a new version), and came across Uninstall C# windows application from self and the accepted answer says you need a 'product code'. What exactly is that, and where can I find/get it from? I have searched for this but can't find anything.

Thank you

8
  • Which technology did you use for creating your applications installer? Commented Mar 5, 2011 at 21:50
  • 5
    You mean you reserved the right to uninstall the application w/o user consent, but you don't know how to exert that right? How ironic... Commented Mar 5, 2011 at 21:51
  • @Doc Brown - I used the built-in publish feature with Visual Studio 2010 Express, which uses Windows Installer 3.1. Commented Mar 5, 2011 at 21:56
  • I'm not even sure those terms of use are legal unless the user has leased the software for a specific period or time. Otherwise, that's like a product manufacturer saying they reserve the right to reclaim your product whenever they want. Seems as if you should allow the client to decide if they want to allow you to fix the bug or just live with the application as-is. Commented Mar 5, 2011 at 22:06
  • 1
    See stackoverflow.com/questions/673233/… Commented Mar 5, 2011 at 22:18

3 Answers 3

4

The productcode can be obtained from your MSI by opening with orca, the msi db editor and lookup the productcode in the Property table. Orca is part of the Windows SDK.

You can also run your msi

msi /i [your msi] -lvx* log.log

and harvest the productcode from the log.

The easiest way is by getting it from the author files of your setup as Ken White already pointed out.

Sign up to request clarification or add additional context in comments.

Comments

2

You created the product code (if it exists) when you created your MSI to install your application. You need the same product code you used in the installation in order to uninstall it via Windows Installer.

2 Comments

The product code is created automatically; And from what I can see, there's no way to find it just by looking for it in the Project Properties etc.
Is the product code the same as GUID? If so, then I've got it.
1

I am not sure about VS 2010, but in VS2008 setup projects have a ".vdproj" project file, which can be opened with a simple text editor (like notepad). If you search for the word "ProductCode", you will find a line like

 "ProductCode" = "8:{GUID}"

(the GUID is what you are looking for).

1 Comment

Thank you - I can find the GUID from within VS Project Properties :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.