Add a custom action on uninstall in Visual Studio 2017 setup project - c#

I have a C# application (winforms) and I'm trying to create a setup project for it, with the following customization: when the user tries to uninstall the application, I want to show a simple dialog with 2 textboxes (email and password) and one button. When the user presses the button, I want to make a request with those credentials and, if they are valid, I want to uninstall the app.
Now, I installed this extension for Visual Studio 2017 that gives me the Setup Project template.
I know that I have to deal with Custom Actions. I actually reached that screen:
But when I click on Add Custom Action, it wants me to upload a script or an executable file.
My problem is: what kind of executable / script do I have to put there? There is a special language built for this installer? Or I can just write C#?
I haven't found any kind of updated documentation on this topic except this one that works for Visual Studio 2010, but I need it for Visual Studio 2017.
Thank you respectfully.

This item template is available in 2017 also.
Create a separate Library project. Add there a new installer item and continue as it is said in the manual you've found

Related

Settings in visual studio setup project

I am working on the Setup Project (msi installer package creator) of a C# desktop application in Visual Studio 2010. I want to add some product activation conditions based on radio buttons in the setup project. I have added a user interface in setup project containing the radio buttons, but i don't know where to get the selected value from this interface, or where is this selection stored.
Image Radio Buttons
User Interface
You can't run code on the button click of a dialog in a Visual Studio setup's MSI. Other tools (InstallShield, WiX, Advanced Installer etc) offer support for all Windows Installer functionality, but Visual Studio setups do not. Those tools let you run a custom action on a button click to validate the input, for example.
So your question is the nearly the same as these:
c# setup project get radio buttons value
How to code for Custom Dialog in Setup Project?
so basically you can pass the values to a custom action. However if you somehow want to change the course of the install based on the choice in the radio buttons there is not much you can do because all VS custom actions run at the end after everything is installed. It might be better to defer all this until the app first runs, and have the app deal with this. I assume that a user might want to upgrade from Demo to Student to Professional without re-installing the product.

How to add a launch condition of searching for a process in a setup project c#?

I have made a setup project for my Outlook Addin in C#(Visual Studio 2010). I want to add a condition to my setup project for Addin which prompts the user to close the outlook if it is open else continues to Install. I'll appreciate any help on this.
Also tell me if somehow we can restart the outlook at finish of installation.
It's possible if you are using VS to create a setup project, but to make it works you have to write a little code blocks and make some settings. Hope these posts will help you how to do that.
How to: Get an Instance of Outlook
Extending Visual Studio Setup Project
Launching Your Application After Install using Visual Studio 2005

Create Custom Installer through Visual studion 2012 in c#

Hi,
I have to create one installer as shown in picture. I have tried with visual studio installer template and I have seen that there is one installer class also. But It's not giving same design as shown in my picture.
When user will click on install button on that time it should install project and other button it will document.
Hope I'm clear with my requriement.

Visual Studio 2013 Publish Profiles saving inconsistently

When I modify an existing publish profile, Visual Studio 2013 Update 1 does not always save the corresponding pubxml file in the /Properties folder. I'm playing a constant game of modifying files until my changes are registered correctly in the file system.
For example, one publish profile that I edited and "saved" using the prompt has its pubxml file marked as delete. I suspect the profiles are cached and Visual Studio 2013 is not reflecting what's in the file system in real time.
The save prompt only shows up when I go to another profile or hit the publish button. It would be nice to have a save button that would force the pubxml files to show the latest.
Does anyone have a clear workaround this? I had a similar experience with web.config transformation in the same project and ended up editing the project file.
I'm certain this is not bound to the specific project I am currently dealing with as I see the same behavior in other projects. I never had this issue in Visual Studio 2010.
You'll not see this issue if you have just created new profiles. I am only seeing this behavior when I modify the existing profiles.
Not sure if this helps, I was able to delete the Profile in the VS GUI.
this is in VS 2013 Professional.
I clicked the Build menu / Publish "yourSite"
Then on the Publish button was able to click it or right click it and then I could see the Manage button show up under the publish section. I clicked that, then was able to delete my original profile. then I created a new one.
I guess once you create a profile the manager button disappears.

Check which visual studio version is the project running with C# code

I'm working in C#, .Net 2.0.
I want to search for a file in My documents -> Visual studio 'version'. The problem is that the user can have multiple VS installed. I, for example, have 2005, 2008 and 2010 and have three folders of VS in the 'My documents' folder.
In order to what I want, I need to know in which version of Visual studio the user is currently working.
I was thinking to open Windows task manager (by code) and in the 'Applications' part to look for the name of the project but I think that doesn't give me the version. Also, that means I'm gonna need the name of the solution of the user.
Other way is, again to open Windows task manager (by code) and in the 'Processes' part, in the 'Description' tab to look for the version. But, what if the user has multiple instances of VS opened?
Is there some combination of the both methods described above? Or some other idea on how to do this?
Use FileVersion mixed with Getting the path of a process (look for devenv.exe)
This should be able to give you the version of Visual Studio based on your usecase, if VS is running.

Categories