Question make it as an Installer?

nokia123

Active member
Joined
May 1, 2011
Messages
29
Programming Experience
Beginner
My project is complete. And now I want to make it as an Installer.
how can i make it a setup file so that user double click it and the software
get installed silently ?

I used in my program ms-access 2007 database and some other sound files which i linked to my project and some vedio files.
Suggest me how can i make all the files as in a single installer or setup.:cool:
 
I did using publish , but there is a problem again. Its not pulling the database file ,when i am running the setup ,after installing ,its saying database is not there and only that code is working where there is no need of database ,if any button i am clicking which has to deal with database the program sayaing quit it or ignore it.

and also there is another problem, actually i provided the link to my sound file and vedio file . i hard coded it and now if i am running the setup on another machine ,the sound and vedio are not working as they are going to the link and there is nothing in that link. how to overcome this. i read that ,Environment.GetFolderPath, My.Computer.FileSystem.SpecialDirectories, Application.StartupPath, will fix my problem but how to use it.
currently i m going this way, Me.WebBrowser1.Navigate("c:\welcome.gif") , how to do this with my.computer.filesystem.specialdirectores or application.startuppath or environment.getfolderpath ?

Thank you.
Thank you.
Use the Publish page of the project properties to create a ClickOnce installer.
 
What database are we talking about? Have you actually added these files to your project? Make sure their Build Action is Content and Copy To Output Directory is True, then check the Application Files from the Publish page.
 
When I am installing it, after installing,It is giving the following error
System.Data.OleDb.OleDbException: Could not find file 'C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\Data\V4VR72MG.ZNH\J2KBMOXK.P2A\fina..tion_13221695a885f2c0_0001.0000_c689c158f61780ba\Data\fulldatabase.accdb'

and if i am manually copy pasting fulldatabase.accdb inside Data folder, as asked by above error, its working .
What is the fix ?
Thank you in advance
 
Where is your application exe stored? Is it in 'C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\Data\V4VR72MG.ZNH\J2KBMOXK.P2A\f ina..tion_13221695a885f2c0_0001.0000_c689c158f6178 0ba\'?
 
no, my exe is not there... after installing my program went to the start and then all programs. I thought ,that after installing, the program goes to c:\program files. But in my case it is, C:\Documents and Settings\Administrator\Start Menu\Programs\Computer_1.
 
So how are you getting this path? ('C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\Data\V4VR72MG.ZNH\J2KBMOXK.P2A\f ina..tion_13221695a885f2c0_0001.0000_c689c158f6178 0ba\Data\fulldatabase.accdb')
 
If you're talking about a database then you are talking about a connection string. The correct way to build a connection string for a local database file is to use |DataDirectory| for the folder path. In a ClickOnce-deployed app, that is a special location that you can't really get another way. In your connection string, use "|DataDirectory|\fulldatabase.accdb" as the data file path and you should be good. Other types of files, you do as already instructed, i.e. add the files to the project, set their properties appropriately and then use Application.StartupPath or whatever to get their location.
 
I don't know. May be visual studio doing this.
So how are you getting this path? ('C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\Data\V4VR72MG.ZNH\J2KBMOXK.P2A\f ina..tion_13221695a885f2c0_0001.0000_c689c158f6178 0ba\Data\fulldatabase.accdb')
 
Connection string is same as you told i.e |DataDirectory|\fulldatabase.accdb , i just saw this in my setting tab
If you're talking about a database then you are talking about a connection string. The correct way to build a connection string for a local database file is to use |DataDirectory| for the folder path. In a ClickOnce-deployed app, that is a special location that you can't really get another way. In your connection string, use "|DataDirectory|\fulldatabase.accdb" as the data file path and you should be good. Other types of files, you do as already instructed, i.e. add the files to the project, set their properties appropriately and then use Application.StartupPath or whatever to get their location.
 
okey,somehow i managed to fix this issue. Using Project ->add existing item , i added all my files there. And using publish tab, the installer is working fine.

But when i am trying to make setup ,using File->Add->Add New Project and then setup project, everything is fine here too except the access database file .the error arising is :-

System.Data.OleDb.OleDbException: Could not find file 'C:\Documents and Settings\Administrator\Start Menu\Programs\fulldatabase.accdb'.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

* And also ,on running the project file after installing, the splash screen remains visible until i manually close it using taskmanager. why?

Thanking you
 
Thank you all, I somehow managed to fix the issue myself but Its due to all yours help that i reached in a position to fix it myself :).Thank you once again.

To those who were/are/will facing the same problem ,the fix is here :) . Actually during making setup, I was enabling it to make the primary output of the exe to appear on the desktop and after installing i was running it and there for it was not finding the path to remaining files. So in my fix i made it to put only shortcut on my desktop and I was good to go :):) .. How stupid i was.. :)

Thank you helpers to bear with me !.. Problem resolved !
 
Back
Top