Prompt user with the default project installer of visual studio? - c#

I've a c# project, and I would like to know if the default free installer, provided with visual studio 2010 allows us to prompt some information to configure the application.
if yes, how?
if no, what can you advice me?
Thank you very much

There are several links you should probably explore thoroughly:
User Interface Management in Deployment
The User Interface Editor can be used to specify and set properties for predefined dialog boxes that are displayed during installation on the target computer.
Visual Studio Setup project FAQ
Setup and Deployment Projects
These will give you a pretty good overview on how to create setup projects, which ones to use, and how to customize your User Interface, once you have a setup project.

This article from Rob Aquila's Blog recently helped me out with this exact question. It runs you through the steps required to make your deployment package prompt the user for input, and then modify your app.config with those values during installation.
One pitfall from my experience came in attempting to configure custom sections in the app.config. Turns out I couldn't use the ConfigurationSection implementation that was already created for the application, due to assembly binding issues that I couldn't resolve. I ended up doing that using LINQ to XML in a custom Installer class.
However, modifying the <appSettings> settings is fairly straightforward.

Related

How to provide options and control for Custom and complete installation in VS installer UI

I have an Windows C# application for which I will have to create an installer
which would ask user for custom and complete installation.These custom and complete installation options are same application with different feature.
I know to provide options by using Installer UI radio buttons but how to provide control as it takes specific exe for the custom and complete installation respectively.
Or is there any way to achieve this, appreciate if you would provdie step by step procedure.
I am using Visual studio 2013 premium version, MySQL 5.5.
You have different ways, you can do it by configurate in VS. But on this I canĀ“t say much. I would prefer to use a NSIS-File or MS-Build to create an setup.exe
With NSIS you can say all Options etc. which the installer should include.
Here is an NSIS tutorial. Hope that helps.
There is no support for custom dialogs in Visual Studio setup projects - they are limited feature setup projects that do not supply access to the full functionality of Windows Installer. Any installs you see with those Custom and Complete choices (or choices of which features to install) will not have been built with Visual Studio setup installer projects. That means you'll need to choose another tool that meets those requirements, and any others you might have for the install.

Add installer to a c# application

I made a search to find how am I adding an installer to my c# application. In every result I found that I need to add new file from Setup and Deployment templates, but I have no those templates. Even in online search I didn't find so.
what should I do?
The VS setup templates were removed post VS-2010.
Now, you have to use something else. "InstallShield" is still available, and Wix is a very popular install framework. You can, of course, just roll your own installer as well.
Alternatively, just use VS 2010 or earlier to create your setup/deployment projects.
I reckon you should do some research. There are many options out there depending on your type of application. Is it an executable that runs locally? Is it a Web application? Or a mobile application?
Microsoft provides lots of options/guides out of the box. Assuming you use Visual Studio 2013 check this MSDN article which is a good guide to start your research journey: https://msdn.microsoft.com/en-us/library/wtzawcsz.aspx

Create Solution/Project programmatically without Visual Studio

I would like to create a Visual Studio Solution and a C# Project programmatically, but without a instance of Visual Studio installed on the machine.
Scenario
I am trying to build a "engine" that will read some metadata in a SQL database and transform them into a UI. The database will be maintained by another people with a Web or WCF interface and I want the Server Application frequently (by schedule or pressing a button) use this informations to create autommaticaly a new version of the software (create solution -> project -> build -> create deployment).
So, I searched about programmatically create Solution and I found only the Automation Model in VS, it's about use an Add-In Project and this don't serves for my propose.
Perhaps I was a little confused in my explanation, so ask me more especific details, so I can be more accurate :)
Thanks for help
I think generating the solution is a little extreme.
The solution file structure hasn't changed much since 2005 http://msdn.microsoft.com/en-us/library/bb165951(v=VS.80).aspx, and there are a few projects trying to automate their generation, like Premake https://bitbucket.org/premake.
However, the kind of scenario you describe, might be I believe (better?) adressed with t4 templates http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx, or only project file generation.
What you are describing is possible to do in C# Windows app but tedious and difficult. I remember seeing VB6.0 app like that but here i would suggest you look into WPF. Still it's C# programming but WPF can load dynamically a "window" from a string or a file if you want.

how to create a installer similar to visual studio 2008 setup

i want to know how to create a installer similar to visual studio 2010 setup file.
thanks in advance.
There is an open source script driven project called Wix which you could use here: http://wix.sourceforge.net/
There are some additional MSI installation file utilities.
Hopefully this helps.
WiX toolset is used to create Windows Installer based installers, MSI files. Visual Studio setup uses MSI to make changes to the system. Although MSI is very powerful, it provides limited UI experience, which, however, is quite enough for most setups.
Visual Studio setup uses a regular application that collects information from the user. Then it uses External UI (see MsiSetExternalUI function) to monitor and display progress of the installation.
Look at Setup guidelines and make your setup experience as simple as possible, but not simpler.

How to programmatically uninstall an application in Windows?

We are releasing a new version of our application and we would like it to be able to uninstall the previous installed version from the client's computer.
How would we be able to do that?
edit: I'm installing this application (and also the previous version) with a deployment project in Visual Studio, so I assume it is a Windows Installer.
Thanks a bunch!
Deployement Project in Visual Studio has a build-in feature to remove previous versions of your application.
Check the "RemovePreviousVersions" property in the Deployement Project Properties.
http://msdn.microsoft.com/library/y63fxdw6.aspx
Edit:
from MSDN:
The installer checks UpgradeCode and
ProductCode properties to determine
whether the earlier version should be
removed. The UpgradeCode must be the
same for both versions; the
ProductCode must be different.
If your using batch or another automated deployment tool for your releases, you can easily uninstall an MSI product using the following command line:
msiexec [/uninstall | /x] [Product.msi | ProductCode]
The Microsoft Installer (*.msi) format supports what you want do to, unfortunately Visual Studio only offers limited customisation and is designed to be used for basic projects.
There are a lot of resources out there on this topic and many other people asking similar questions. My best advice would be spent some time researching the MSDN documentation.
...
Update
OK. After spending 30 minutes reading a few articles, I think it may be possible using a custom action that you package with your new installer.
Follow this MSDN article on creating a Custom Action. It involves creating a new class library, adding an System.Configuration.Install.Installer class, adding it as an output to the setup project, and then selecting it as a custom action.
To view your custom actions tab, right-click on the setup project and select View > Custom Actions.
From here: you will need to write the code to remove the installation directory and AppData profile. This article on how to set Custom Action Data may be helpful.
Good luck.
HTH,
Dennis
If this you program then that's a simple reverse batch.
Or you could use some installer/uninstaller builder like NSIS

Categories