This is the most important tutorial for creating the Setup File(.exe file) from windows forms application.You can easily install it any windows computers.You can use it only windows platform.
In previous tutorial i have shown "How insert data is database and print the grid-view data in windows forms application"
Now i am going to convert these windows forms application to the Setup File. Friends who have not read my previous tutorials please read first this tutorial and download it, otherwise you will not understand correctly.For read the previous tutorial .
There are some steps to create Setup File From windows forms applications. please follow these steps carefully.
Step1:- First open your windows form application in your visual studio.Here i am using visual studio 2010 and my windows forms application Name is "test",which had made in previous tutorial.you can download it Click download.
Now i am going to open "test" application in visual studio 2010,my "test" application is on desktop. See it carefully and open your application together.
Step2:- Now open "test" application in visual studio 2010,which is given below, follow it. Open visual studio 2010->File->Open project/solution->select the application "test"Folder_> click open.
See it:-
Step3:- First see Form1.cs,Form2.cs and Solution Explorer window for remember previous post.
Form1.cs:->
Form2.cs:->
Step4:-> Now open solution explorer(if not open)->Add New Item->Select Application Configuration File->Click Add
See it:->
See App.Config File:-It is used for creating connection to the database. It is optional.
Step5:- First create table in database,here i am already created "RAM"table in previous tutorial.See it:
- write the connection string for creating the connection database table "RAM" in app.Config file.if You want to create otherwise escape it
See it:->
Step6:- Now this is main step to create the step. Open Solution Explorer->Click on 'solution'test'('project)->Add New Project->Select other project types from left window->Select visual studio Installer->Select the setup Wizard-> write your setup name in below(mysetup)->click OK.
Step7:-
- One wizard will be opened->click 'Next' Button.
- Select Radio button "Create a setup for a windows application" ->Click Next.
See it:-
- Select "Primary output from text"-> Click Next.
- Click Add Button->go your application folder,which you want to create setup.
- Select the "App"File from your project ("test")-> click Open Button.
- Now click Next Button.
- Click Finish Button.
- Now click Application Folder From left side window.
- Go right side window-> Right mouse click ->Add file->select icon file (extension . icon) , This icon will show on Your desktop when you install the setup on computer.
- Now create shortcut file of "Primary Output File" by l Right mouse click on Primary Output File.
- Now change shortcut folder, here i have changed 'mysetup'.
See it:
- Now Right mouse click on ' mysetup' Shortcut and go property window.
- Click Icon and select browse.
- Click Browse Button.
- Click Application Folder and select "mysetup"Icon file->click OK.
- Again select icon file and click OK button.
- Drag and drop 'mysetup shortcut' User's Desktop (left side window).
- Now again create shortcut primary output->rename it again mysetup -> again add icon File from the mysetup property window as before we have added.
- Now Add New Folder in "User's program menu"(left side window) and change Name it as setup->Now again Drag and Drop mysetup shortcut to the setup.
- Now go "Solution Explorer window"-> Right mouse click on mysetup->Click Build. wait some time whenever setup is not successfully build-> Your setup is build successfully->Go and open your application Folder("test").
- click mysetup:-
- ->Click Debug Folder.
Step8:- Before installing the setup you First install .NET FRAMEWORK 4.0 on your system,Click here for download . whenever you install this setup on your window (OS) and open it then you will see like this:-
Note:-I have seen that many student face problems.Read below link.
Step9:-If you want you can create setup file in visual studio 2012 and visual studio 2013 also.
For More...
- Print the Grid Data in Windows Forms Application
- How to build real form filling application in asp.net like IBPS
- Create .dll File and Use in Asp.net Application
- Take Print receipt in Windows Form Application
- File Handling Real Application
- Create Setup File(.exe) with SQL Database(.mdf)
- How to implement WCF Services in asp.net application
- How to implement form based authentication in asp.net
- How to implement caching concepts in asp.net application
- How to implement cookie in asp.net application
- Transaction in sql server
- Web Form control in asp.net
- Operator over loading in c#
- Multithreading in c#
- How to implement session state in asp.net application
- How to use secure login page in asp.net with example
- How to Add and verify Captcha image in 3 tier architecture in asp.net
- How to use virtual keyboard in asp.net for security purpose
- How to implement hashing concepts in asp.net
- Learn complete .Net Interview Questions and answers for job seekers
- Learn complete Python course from your home
Please share this with your friends ,its may be helpful for them.
To Get the Latest Free Updates Subscribe
Download Attached whole setup file:-
DOWNLOAD
good yaar.its working
ReplyDeletethanx @sachin
ReplyDeletei did not want install sql server ,then how to create a set up with database file (.bak file)
ReplyDeleteExcellent Dude...........!
ReplyDeletethanks.
ReplyDeleteHey..I have developed a windows app which will use sql server dataabse...My doubt is how to add the database info to the setup file???
ReplyDeleteselect your DB file when you are adding project output file
DeleteIf I don't want to use App.config file then what is the procedure?
ReplyDeleteNice Post..thanks
ReplyDeletebut if install application into another system..then its giving me an error..like database can not open...the login failed...
ReplyDeletepls rpl...
great example sets arerpose here for practice purpose
ReplyDeleteHow Can I add dot net framework4.0 to the setup file
ReplyDeletei did not want install sql server ,then how to create a set up with database file (.bak file)
ReplyDeletei am new to windows application.. i developed a small project is maintain a details of guest. i want to create a exe. and one more i design a database in vs2010... not a sqlserver..
ReplyDeleteafter install into client system it make a error... "no database is found or db is exist or unc share". how can i solve this problem..
if i do successfully, then i don't need to sql server on my client....please help me frnds
hiiii
DeleteFriend! add sql server database in the setup file when you are creating the setup in windows form application.
DeleteThanxxxx
ReplyDeletethank a lot freiend
ReplyDeletewindowsxp service pack 2 can instal this setup file
ReplyDeleteyes, you can install but first install .NET framework 4.0 on xp service pack 2.you can download this setup from Step7. first install it after that install setup.
ReplyDeletethanx brother... my only doubt is if i include the database file in the setup.. will i still require to install sql server 2008 as my database is in it.... and how to change the connection to the database when i install the application on different computers...
ReplyDeleteYes brother,sql server 2008 is required without sql server verification you can not open the connection so your setup will give error. first you install the sql server on the computer where you want to install this setup.create same table name,column and row as your sql server table name,column and row. before creating the setup,first you insert sql server name for connection after that create the setup then you can easily install easily the setup without any error.
ReplyDeleteThanks!!!!
ReplyDeletesuperb..!!!!!!
ReplyDeletehow to add access database in vs2008
ReplyDeleteread this:
Deletehttp://www.msdotnet.co.in/2013/04/how-to-solve-problem-to-add-sql.html
http://www.msdotnet.co.in/2012/08/how-to-add-sql-database-mdf-in-aspnet.html
hi,
ReplyDeletei have created the .exe file of my application. Now i want to run it on LAN. I used windows xp sp3, vs2010,management studio 2008 r2, when i,m going to run software on lan that time it give me error of connection string. in connection string i give the servername like "max-d7444sb\sqlexpress initial catalog..... exe.mdf" but it not work.
plz help me for this problem.
@amit gurav
ReplyDeletego your APP.config file and change your connection string as given below:
ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString
and ADD system.Configuration file in your solution explorer
then create setup .it will work.
good it work
ReplyDeleteHello sir,
ReplyDeleteThanks for the replying. It is help full for me.
How can i add image in crystal reports?
version 2010.
vs2010
hi,
ReplyDeleteyour suggestion is use full for me. Thanks for replying.
I want to add image in crystal reports2010, how can i add it?
version
crystal report2010
vs2010
@amit gurav
ReplyDeletewhich model you are using for making crystal report.
1. Push model
2. pull model
I will upload crystal report post within few days.
Hi Verma .how i can create a setup file for virtual printer?is it possible to create in windows application?in that virtual printer print button click on print it stores the data in our database it is possible plz let me inform thanks in advance...
ReplyDeleteThank's very excellent
ReplyDeleteThank's its working
ReplyDeletesir, I have developed a windows app which will use sql server 2008 database , created and
ReplyDeleteinstalled setup file in another PC then its giving me an error..like database can not open...the login faild but i do not want to install server 2008 completely, i want to install
database through setup file. please give me reply
i have a c# windows form application including access 2007 database ,
ReplyDeleteapplication is working fine,
but problem is,
now we want to run this application through LAN,
in LAN connection,there is one server,
the query is --->> only from the server user can edit/update and after updation all the database automatically updated in all the connected pc..
how can i do this??
can you please help me in this!!!!
remote base access
nice article dude.... very good for beginners..........
ReplyDeletePerfect! Perfect!!
ReplyDeletehello sir,
ReplyDeleteIn my project if i click on print button then it show the preview in rpt file. Now i dont want preview. So how can i print the page directly on clicking print button?
@amit gurav,first visit:-www.msdotnet.co.in/2012/06/how-can-take-print-receipt-and-save.html
Deleteafter that go step 9 and delete the button codes:-
CaptureScreen();
printPreviewDialog1.ShowDialog();
after that write the following codes:-
CaptureScreen();
printDocument1.Print();
and save the application. you can directly print the documents.
Thank You Sir
ReplyDeletehow to make setups which can run on any window computers without installing .net framework
ReplyDeleteThanks a lot it was gret example,but wheb i was run set up on windows 7 pcs then set not working
ReplyDeleteit is working all windows platform,but you will have to install .NET Framework4.0/4.5 first on your system.
ReplyDeletethanks Alot sir.. TC
ReplyDeleteExcellent solution...
ReplyDeleteI want to add sql server 2005 database file with setup which will fetch data from database...what should i do?
ReplyDeletev gud..its really very easy to learn..thanks
ReplyDeletethanks very useful post thanks a lot
ReplyDelete@Nishinta Parikh , you can add sql server 2005 as 2008 visit:-
ReplyDeletehttp://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
hi Ramashanker , I have created a windows application and i added a database of sql server 2005. I want to create a setup file with that database but i don need to install the sql server on the clients system.. for that what should i do??
ReplyDeleteRead this post:-
Deletehttp://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
How can i Create Setup through VS2012
ReplyDeleteFollow above steps,it is same for visual studio 2012 also.
Deletethankx !!!
ReplyDeletei am creating windows application and using my sql as a back end.
ReplyDeletehow can i create exe file and after installed it on client machine which has no my sql installed, how can i access database from main(target) system.
please help me!!
read this post:-
Deletehttp://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
Thanks dear its really helpful
ReplyDeletehi i am akash and i am fresher and i have no idea for dot net how to work and at all process so please suggest me all process because VB ,my sql Installation and how to stating and all activities.
ReplyDeleteplease suggest me.
hello sir i m jais from delhi and i want create a exe software in visual studio 2010 so please tell me how i m doing this and where i start this task .???
ReplyDelete@jais singhg , install visual studio 2010 in your system-->follow each step which i have explained above.....you can install this on your system.
Deletecrystal report not working in setup file???
DeleteDear Sir, There is no 'Primary Output from Text' option in the 3rd screen of 'Setup Wizard'. How to get it?
ReplyDeleteHi rose,if Primary Output from Text' option is not present ,create it by right mouse click...........
DeleteMany Many Thanks..........
ReplyDeletehello sir ,
ReplyDeletehow to i create a report form in visual studio 2012 ?
how can i create upload and download form
ReplyDeletehow its works on other system with database???? plz reply sooon..
ReplyDeletei have intalled the .NET Framework 3.5 version.....will this application work?????
ReplyDeletei have created this setup from visual studio 2010.so you have required .NET FRAMEWORK 4.0/4.5.If you create this step from visual studio 2008 then it will work .NET FRAMEWORK 3.5/4.0/4.5.
Deletei have created an setup with attached service based database name sclrd.mdf but when i goes to run setup it shows the exception-Unhandeled exception has occured in your application .
ReplyDeleteAn attempt to attach an auto name database for file C:\program\Default Company Name\sclrd.mdf failed .A database with this name is already exists. or specified can not be opened,or it is located on UNC share.
Sir please tell how to create setup file using VS 2012 also
ReplyDeletehi Manjunath ! follow same steps in visual studio 2012.all steps are same.........
DeleteI have created myfolder as per above information(Tutorial) And That folder contains following items:
ReplyDeleteApplication Files -folder
dotnetfx40client -folder
sqlexpress2008 -folder
windowsinstaller3_1 -folder
windowsinstaller4_5 -folder
PayrollManagementSystem.application (Application Manifast) -file
setup.exe
It works but i want to make a application logo on my PC desktop when i installation is complete.
how can i do this?
Hi Prajakta ! First download icon file (logo) from internet or create it custum which you want to show on your desktop pc after installation the setp file.
DeleteI have mentioned this on step 7.Read Step 7 carefully all points and implement it on your setup file.it will work definitely..
Excellent Great job....!! Thank u sooo Muchhhhhhhhh....!!!!!!!!!
ReplyDeleteIs the above info(tutorial) useful when my project has database in SQLexpress2008 ?
ReplyDeleteYou've done a great job thanks a lot.
ReplyDeleteSuppose I want to add database to my application and then create the Installer. Now my client (system on which the installer/setup has to be run) is not having any SQL server installed. What can I use to store data? Are XML or txt file the only solution?
ReplyDeleteyou can include database in installer file.read below post:-
Deletehttp://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
Thank Alot Sir
ReplyDeleteI have created setup file. but i need "Version update" when we Reinstall the setup again like 1.0.0.0. because of which i can directlly install a setup file instead of Uninstalling the older setup and again installing the new setup.
ReplyDeletehi Naresh ! Create setup file in visual studio 2012 ,In this ,version update is available.Read below post and create setup file in visual studio 2012.I have already build a calculator application ,you can check it on your system...
Deletehi ,
ReplyDeletewhen i create setup as your above artical but it give error when i run the setup of my project that is "An error occured loading a configuration file: Access to the path 'C:\Program Files\Default Company Name\ Setup1\cstyx5cw.tmp' is denied.(c:\Program Files\Default Company Name\setup1\cms.exe.config)"
please help me how can i solve this problem ? tell me about that
and i am trying to create setup file of my project with database but every time this error will detect and on client pc i can not run application sucessfully. please give any solution
Hi priyanka ! when you install setup file then change your drive path instead of c drive then it will work definitely. because Your windows file denied this installation .
DeleteThanks ^^
ReplyDeletehi ramashanker ! as you suggest i do setup of my project but in configuration i set value of variable and when i execute application then value is display.for e.g. if value is set like c = 1 and second time it display c=1.1 and third time c=1.1.1 and so on so how to solve it because value is assign to config variable
ReplyDeleteplease reply fast.
hi ramashankar ! as you suggest i completed my setup and its wok but problem is that my config variable value can not clear after closing application and next time value of that will display again with new value so please say that how i can clear value of config file variable at the time of close application
ReplyDeleteplease reply fast
hi priyanka ! In your page load initialize variable c =0 ; so when your application will loaded then your variable value(c) will be initialized zero.It will work definitely....
Deletehi Ramashanker ! in my application i was create some RDLC report and set path like this.......
ReplyDeletereportViewer1.LocalReport.ReportPath = Application.StartupPath + "\\Reports\\BillReports\\PurchaseOrderBillFormat.rdlc";
but it doesn't work . can you suggest any thing else for report path.
thanx for reply
hi Ramashanker ! In my application i was generate report and set path to that report viewer like following but it doesnot work can you say onther way of assign path to report......
ReplyDeletereportViewer1.LocalReport.ReportPath = Application.StartupPath + "\\Reports\\BillReports\\PurchaseOrderBillFormat.rdlc";
OR
reportViewer1.LocalReport.ReportPath = Application.ExecutablePath + "\\Reports\\BillReports\\PurchaseOrderBillFormat.rdlc";
Hello Sir,
ReplyDeleteI have created EXE setup file of my project and i have given my database connection string in app config file it runs on my machine but when i am trying to run this setup file on another machine that time it given connection error.
So how can i solve this ?
Hello Sir,
ReplyDeleteI have created EXE setup file of my project and i have given my database connection string in app config file it runs on my machine but when i am trying to run this setup file on another machine that time it given connection error.
So how can i solve this ?
your app config code will be different for other computer, first find data source name for other computer and put them with your connection string codes.After that create setup file.
ReplyDeleteif you want to no changes in connection string code then follow below link:
http://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
your app config code will be different for other computer, first find data source name for other computer and put them with your connection string codes.After that create setup file.
ReplyDeleteif you want to no changes in connection string code then follow below link:
http://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
Hello Sir,
ReplyDeleteI want to create a exe which will be execute only 1 time or execute only 1 pc can you help me????
How can we modify the setup for applications including a crystal report?
ReplyDeleteI have created setup file as per above steps but errors occurs like Error 2 Unable to find source file 'D:\IT-DEPT\SBill - Copy\SBill\mysetup\stdole.dll' for assembly 'stdole.dll', located in '[TARGETDIR]'
ReplyDeletehow to prevent the program to install in the default directory 'C:\Program Files'
ReplyDeleteyou can choose different directory (instead on C:\Program files) path when you are installing this setup file on your computer...
DeleteI can not able to add icon in my project. Although the icon is added in User desktop or in Application folder. But it could not add with the property of shortcut. Please help me how to fix the icon in my setup file.
ReplyDeleteplease friend i m createing a window form in asp.net but i don't know how i connect to oracle database to asp.net how i connect and whats a codding to connnection to asp.net please tell me any body who know about this plz help me...
ReplyDeleteI am creating setup in visual studio 2012 with sql server database 2012 and SAP crystal report also.
ReplyDeleteI run setup on xp sp3 but i got error Application error what am i do
than which software are install before run a setup on client computer
I am creating setup in visual studio 2012 with sql server database 2012 and SAP crystal report also.
ReplyDeleteI run setup on xp sp3 but i got error Application error what am i do
than which software are install before run a setup on client computer
I am creating Setup (Windows Application) in visual studio 2012 with sql server database 2012 and SAP crystal report also
ReplyDelete1)before i run setup which software are install on client computer
2) i run setup on client pc i got error Application error
What am i do
Thank you Sir....
ReplyDeleteI understand to create setup file from this.
Its working well.
sir i create a winform with sql server database and create a setup file as you teach but when installing on another system it gives error sql server express not found on system what wil i do plzzzzzzzzzz
ReplyDeleteHi GHS JANGLA,
DeleteYou can install sql database on that computer also and create same table name and column name as given in your setup file.otherwise you have to create setup file from below link..
http://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html
Hi I just want to execute an exe file using windows application ,I jus need an procedure frm first
ReplyDeletehai
ReplyDeletehi ramashankar ! as you suggest i completed my setup and its not working but problem my system is visualstudio and sql server not installed,
ReplyDeleteplease reply fast
Thank you very much for this tutorial.
ReplyDeleteI create a setup file and its shorcut user'desktop file for my apps but after installation when i run my apps from shortcut it's give an error " operation must use an updateable query."But when i run my apps as administrator then its works correctly.
ReplyDeleteSo plss give me suggestion how to provide write access on db for shortcut desktop's file so that we need not run my program as administrator.
Hi sandhya,
DeleteThere may be following problems,read below link
https://support.microsoft.com/en-in/kb/175168
http://forums.asp.net/t/154273.aspx?FIX+Operation+must+use+an+updateable+query+error+when+using+Access+db
Hello...sir.. I am Ajinkya Mate.. i have created set up file.. but after executing this set up file in another system it work properly but CRYSTAL REPORTS are not open.. it gives me error unable to open file
ReplyDeleteI am unable to see the images.!!
ReplyDeletebut that install on another machine it show error object reference how to handle that
ReplyDeletei have created application and a table is attached with it with the help of search box i cand find details of any user. i want to an exe file please help ..
ReplyDeletehello there,
ReplyDeleteI'm Nadeem i'm looking to create setup file for my setting wizard to take information regarding company which will use & the wizard is also part of project. In Short i like to create custom page setup first then like to execute my application setup. would you guide me to do so how can i ?
we done a project in vs2010 and sql2008r2 database. after converting to .exe file and installed in another pc..it dosen't work eventhough we have sql in that pc
ReplyDeleteHello Sir,
ReplyDeleteI have created EXE setup file of my project and i have given my database connection string in app config file it runs on my machine but when i am trying to run this setup file on another machine that time it given an error "unhanded exception has occurred in your application if u click continue the application will ignore this error and attempt to continue".
So how can i solve this ?
Hello Sir,
ReplyDeleteIcon is not showing on desktop on below step
Go right side window-> Right mouse click ->Add file->select icon file (extension . icon) , This icon will show on Your desktop when you install the setup on computer.
Thanks,
Garima
Hi garima,
ReplyDeleteYou have to follow each step carefully.then when you will install your setup file ,icon will be showed on your desktop.otherwise you can download whole project file from below and see
Thanks you Sir,
ReplyDeleteHelp me a lot :)
I have recently installed VB 2017 on my system does the procedure remains the same?
ReplyDeletePlease Help sir,
Regards,
Shivansh
Hi I am Naveen,
ReplyDeleteI am created setup file for my project using your setup creation process finally .EXE file also created,but i will try to install exe file at the time following error message has been showed, please help me to solve this issue:
Error reading from file: E:\test\setup\Debug\setup.msi. verify that the file exists and that you can access it.
Thanks it Help me lot :)
ReplyDeletethanks its working.....
ReplyDeleteI have made a windows application using Visual Studio 2015 with database integration using SQL Server Management Studio 2014. I wanted it to be deployed on some other machine for that purpose, I have made the .exe file but when I install the .exe file on the client's machine it shows a connection error, I know why this happens because the clients machine doesn't have SQL server and I have used connection string in the project according to my SQL server and set the path according to my machine. I just wanted to know is there any way that I can get a .exe file that no needs external SQL Server for database and it should reside inside the application as client installs it and ready to go without any need of SQL Server separately.
ReplyDelete
ReplyDeleteNice article and explanation Keep continuing to write an article like this you may also check my website
Advanced Installer crack