I've been struggling with Visual Studio to create a windows installer msi.
This is what I was hoping to create in the msi:
Installer opens and first page has a couple fields where you can enter various config locations, including being able to browse, and also some drop downs with various config setups.
Click Next or Finish or whatever and custom C# code I have written gets executed depending on the choices chosen by the user.
When looking at the Visual Studio Installer Project, I can add a dialog, but they are all predefined for me. I was hoping for something like when you create a Windows Forms Application.
Is this not possible? Is the windows installer project just that inflexible? What are my other options in Visual Studio (note I don't want to use another program that may be out there)?
The Installer class gives you a way to take get full control of what happens during installation for a VS installation project. However, you would have to use a modal dialog to collect the information you're describing, so the user experiecne would not be as smooth as an integrated wizard page.
I strongly suggest you to take a look into WIX.
It is more complex than VS install projects but it is much more flexible also
Related
I have existing project. I tried to add new empty form in this, but I have limited choose of windows form that mean to inheriting. But I need just simple form.
I use VS 2017
It seems like you didn't install the required components. To do this, close VS, run your Visual Studio Installer (you probably installed VS through it), click modify for your VS Version and make sure that .Net desktop development is checked:
Then launch the installation by hitting Modify and start VS again. If you now want to create a new Project it should look something like that:
Try this
Open Solution Explorer
Right click on your Project's Name.
Add.
Windows Form.
If you still don't see it, you might be missing the Dot Net desktop development Component.
I have a Windows Service Application which contains one Service.cs and one Windows Form Application.Now as per my requirement i have to make a setup installer of this application which i did using Visual Studio Setup project under Deployment Section.
Now if i will install my setup Windows Service file will be added as Service and we can see it and its working fine also but i am not seeing the windows form application.
In the control panel add/remove program my application has been added as i am seeing it but windows form application is not showing in All programs of start button.
Please help me .
Thanks in advance.
If this is urgent:
In the File System Editor for the setup project, it should show the target machine's file system. By default, the primary outputs you've specified will be set to install to the "Application Folder". But what you want to do is to look under the "User's Programs Menu" (I can't remember if this shows up by default - if not, right click "File System on Target Machine", "Add Special Folder" and select this folder).
Then, in the right-hand pane, right click and choose "Create New Shortcut", navigate down through "Application Folder", select the windows forms application and hit OK. Then give it a suitable name.
If this isn't urgent - go and find a better setup tool and learn how to do similar things to the above using that tool. Visual Studio 2010 was the last version to include the Setup project support, so spending time learning this tool now is wasted time. Better to find a tool that will continue to work as you upgrade VS versions. I'd normally suggest WiX since it comes at a great price (free) but it does have a learning curve (since you author the setup in XML).
I recently created a Windows application project using C#. I have completed all the codings. Now i have to deploy the project. So, i created the SETUP of the project using the visual studio's SETUP PROJECT from the Menu. It works fine, i dont have any kind of issues with it. But the genreral setup i get after deploying the poroject is MSi and it looks very simple.
But the thing i need to know is that, is there any way to create a custom setup? The thing i mean to say is that i want to add logo for my project inside the installer. And certain things like during the installation process, the wizzard should ask for user name and password and few more things like these. For eg: if you are insalling a software like visual studio or some other software the installation wizzard is very catchy and the look & feel is good. Similarly i want to get a setup for my project.
Im not sure how to achieve this.
I tried using the installer class of the visual studio project and im not sure if its the correct option for me so instead of wasting time i just thought to ask it here?
I thought that there may be few third party tools for achieveing this. I tried InnoSetup 5.2 but there i have to write programs manually which is similar to pascal.
Also i heard about the tool called as InstallShield, but it costs and im looking for a free alternative.
Is there any third party tool or software for creating SETUP of visual studio projects.? Or is there any method which i can follow to obtain my customized setup?
You can use a Microsoft Setup project or WIX (easily integrate with Visual Studio).
Both are free.
You can do almost all of your customization in setup project by adding custom actions.
WIX (window installer xml) is the better option. You can do a complete customization from wix but it take some time to understand as it is totally based on XML. Microsoft office 2007 and later setups are based on wix.
The difference between wix and Setup project is that you have more control over the GUI of setup in wix than setup project and wix allow much more customization then setup project.
Take a look at this step by step tutorial for wix.
go through topics here Deployment Tasks and Walkthroughs - setup projects are very flexible especially with custom actions. you definitely can setup your own images and tune UI.
If you use Visual Studio MSI
For the first question about adding Icon (based on SplashBitmap), see this MSDN page.
For the second question about authentification input, refer to this other MSDN page.
You can especially use Action personalized, you can follow these steps:
Select the Installer project custom actions in the Solution Explorer. On the View menu, point to Editor, and choose Custom Actions.
The Custom Actions Editor appears.
In the Custom Actions Editor, select the Install node. On the Action menu, choose Add Custom Action.
In the dialog box, select an item in the project, double-click Application Folder.
Select the Primary output from OpenWeb (Active).
Click OK to close the dialog box.
In the Properties window, select the InstallerClass property and set its value to false.
In the Build menu, choose Build Custom Action Installer.
I am developing a project in Visual Studio 2008 with a team of 5 people. Each of the 5 people develop Windows forms and a repository in maintained on the server. The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project.
I want to add and compile the forms using a GUI and not Visual Studio as such. Is this possible?
Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed. Any help will be highly appreciated.
Thanks!
The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project.
You can csc.exe which is a commandline C# compiler. Make a script that pulls the code and compiles it.
I want to add and compile the forms using a GUI and not Visual Studio as such
I don't understand .Do you want to add and compile forms using a GUI app or add GUI?
Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed
If you had already a project that is set-up (dependencies) is it fairly easy. You have to add C# code to the source code. It depends on the size of a modification, but it should be done with a couple of lines of script.
You could either develop scripts to execute msBuild tasks from the command line (command line reference) and develop a GUI to start a shell to run those, or you can use the csc.exe from a script/command prompt to do the compilation manually.
The MsBuild option will be useful if you have project files you want to build, the csc option is more low level and will require more work but will not require you to have a project file, just the source code files and dependencies.
This sounds like the wrong way to go though. Are you sure that you don't want to develop an application that can have plugins? then you develop each form to an interface and package it up in its own dll, and have the application load the plugin dlls and extract out the forms which implement the particular interface. That way you build the app once, and can add new forms without having to recompile at all...
You might want to consider using a plug-in/add-in framework such as MEF or MAF. Team members can then be responsible for their own forms which are popped into a plug-in for you to use.
Choosing between MEF and MAF (System.AddIn)
Such a thing allows you to dynamically control how forms/controls are displayed at runtime or depending how you implement the plug-in system, allow you to drag-n-drop your layout at design time.
Much like user controls.
i wanna deploy a C# Windows Application project using Setup and deployment project technique
but i don know what should i use
after i open File > New > Project > Setup and deployment > ....
then what ,, what should i do next
In the past I've used the Visual Studio Setup Project or Innosetup for my programs. I prefer to build .msi's over exe's so Visual Studio Setup Project has been my goto for a while now. It is however, very lacking in capabilities. The interface is not intuitive either in my opinion. Every time I build an installer there is a lot of trial and error install/uninstall to get it right. Other's have pointed out WIX and I've looked into it. It appears to be very flexible and since it is open source, we should be able to count on it for the long term.
Here is a recent article about WIX. What I found interesting is the article claims (see link in article) that Visual Studio Setup Project is being End Of Life'd in VS 2010 + NEXT_VERSION. This is a little disconcerting to me. Since I don't want to begin to rely on the new Install Shield "Lite" in VS, I'm going to put effort into learning WIX. I hope it'll pay off in more flexible builds for my applications as well.
All that said, when creating a VS Setup project, I usually use the wizard to put in the initial plumbing. You'll point it at the files you want in the .msi. Typically for me this means the "outputs" of one or more programs in my solution. Any managed assemblies referenced in the programs will automatically get picked up as dependencies and included. Unfortunately unmanaged assemblies don't and I usually have to add them manually using the "File System Editor" mode in the Setup Project UI. Adding shortcuts is a little hokey as well. You right click under the start menu and desktop section of the "File System Editor" mode and select create shortcut. This is all by memory so hopefully I'm getting this right. You will certainly have to test your installer multiple times before you get it just how you want. I like to test under a VM as well.
Finally, the VS Setup project produces a setup.exe and .msi file. Setup.exe is used for detecting and installing dependencies (such as .Net) before unpacking the actual DLL.
When u do this File > New > Project > Setup and deployment >
then right click Application folder> Add > File...and add your app's .exe file and also you can add shortcuts of your app in desktop and program's menu
I would recommend you to go for some tool for creating msi.
I am using WIX
What you need depends on... what you need.
For a large percentage of applications, all you need the installer to do is let the user choose an install location, copy files to a directory structure at that location, and create a few shortcuts. For that, a Visual Studio Installer -> Setup Project is fine. It can handle this basic functionality, as well as installing prerequisites like the .Net Framework redistributables, providing custom install options, and/or writing simple registry keys. The Setup Wizard creates a Setup Project as well, but runs you through a wizard to set up the basics. This is a good option if you've never created an installer before.
If you want this application to be controlled by a larger, more custom install, choose the CAB Project; it will simply pack the necessary files into an archive that is easily accessible from another setup project.
If you are publishing a class library, use a Merge Module. Merge Modules work within install programs themselves, providing files needed for the main application to work.
If you need serious customization, or you want to interface with existing InstallShield logic, I'd get a third-party installer. I've worked with InstallShield before, and it's pretty full-featured, but by the same token, the installers it creates are applications in their own right and can take days or weeks of logic programming to "tweak" to your satisfaction.