locked
Confuse on deployment options? RRS feed

  • Question

  • Hi All,

             I have done googling on both clickonce and msi. I am bit lost which to select for my requirement is as below.

    1. MY application is a WPF app using sqlite db. 

    2. I am using third part tool devexpress.

    My issue are

    1. How to deploy my sqlite. Currently my sqlite file is location in the debug folder. So first I have added the sqlite db file by just drag and drop on my project name and I can see the file in my VS 2015 file list. My confusion now is the build action some link say make it as content but other as embedded resource. Can you guys lets me know which is the right method to link it so I can deploy ?

    2. Once I have installed where are my files location in the client machine I mean my .dll , exe and my sqlite db where are they are installed cause I would like to confirm if everything is installed properly.

    3. In future say I will make changes and create new version of application.

       a)In this version how to handle the db for existing user? 

       b)How to handle for the new user who dont have the software yet but there are going to be new user?

    4. How to just handle db updates say changes to some fields or adding some tables?

    Will clickonce be able to handle all these or should I use msi ? 

    Thursday, January 21, 2016 10:53 AM

Answers

  • 1. How to deploy my sqlite. Currently my sqlite file is location in the debug folder. So first I have added the sqlite db file by just drag and drop on my project name and I can see the file in my VS 2015 file list. My confusion now is the build action some link say make it as content but other as embedded resource. Can you guys lets me know which is the right method to link it so I can deploy ?

    Don't make it an embedded resource. Make it a resource. It will be recognised as a dependency by most installers like the installer project.

    https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9

    2. Once I have installed where are my files location in the client machine I mean my .dll , exe and my sqlite db where are they are installed cause I would like to confirm if everything is installed properly.

    Depends which option you use.

    Clickonce deploys to the user's appdata into an obscured folder.

    If you use a different installer like those which generate msi then everything will usually go into a folder in program files unless you tell it otherwise. With the database you should do.  You should deploy it to a folder in appdata since you want any user to be able to write and create their database and program files has some pretty significant limitations.

    3. In future say I will make changes and create new version of application.

       a)In this version how to handle the db for existing user? 

    With clickonce that's a bit tricky because it installs your new file and renames the database by default.

    See this

    https://robindotnet.wordpress.com/2009/08/19/where-do-i-put-my-data-to-keep-it-safe-from-clickonce-updates/

       b)How to handle for the new user who dont have the software yet but there are going to be new user?

    They install your new version. It's usual to make each version a complete re-install effectively. That can be explicitly or implicitly with the installer removing the older version's stuff silently.

    4. How to just handle db updates say changes to some fields or adding some tables?

    Scripts are code are advisable.

    You need to potentially be able to move data around as well as add fields etc,

    It's common to have a "first run after update" mode or even a separate exe which runs.

    One option is  runonce in registry for this.

    Will clickonce be able to handle all these or should I use msi ? 

    Both can handle all these, in slightly different ways.

    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    Monday, January 25, 2016 8:06 PM

All replies

  • Hi sukbir,

    >>2. Once I have installed where are my files location in the client machine I mean my .dll , exe and my sqlite db where are they are installed cause I would like to confirm if everything is installed properly.

    You could use File.Exists("filePath") to check the file's path.

    Sample:

                string path = Application.StartupPath + "\\needfile.txt";//file path
    
                if (!File.Exists(path))
    
                {
    
                    //do something
    
                    MessageBox.Show("file not exist!");
    
                }
    

    File Class:

    https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx

    >>3. In future say I will make changes and create new version of application.

    You could add permissions tables to the database and use these to control the user's permissions.

    >>4. How to just handle db updates say changes to some fields or adding some tables?

    I think you could get more support at SQLite forum.

    >>Will clickonce be able to handle all these or should I use msi ?

    Clickonce operations easier, MSI provides more customize settings. I think all they can competent your needs.

    Regards,

    Moonlight


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Friday, January 22, 2016 10:02 AM
  • If you are using VS 2015, then one option is to use the free Community Edition and add the installer project extension to create a MSI setup. There is a prerequisites option that will deploy prerequisites like SQL and NET and then install your MSI. You don't actually mention using Visual Studio at all, so it's not clear to me if the question is relevant to this forum.

    Choosing between ClickOnce or MSI:

    https://msdn.microsoft.com/en-us/library/ms973805.aspx

    You don't need to "confirm if everything is installed properly" after your MSI install. It will either work or fail and there is no such thing as some files installed and others didn't.

    In a VS setup project you do an upgrade with RemovePreviousVersions.


    Phil Wilson

    Friday, January 22, 2016 7:08 PM
  • Hi Sheng,

                 My question regarding 2. is that once I installed using Clickonce which folder location will the files be installed on my client machine will it be c:/program filer or where else?

    Saturday, January 23, 2016 4:17 PM
  • Hi Phil,

              So are you suggesting to pick msi rather than clickonce? Yes I am using VS 2015. So how to install sqlite with MSI ?

    Saturday, January 23, 2016 4:21 PM
  • Hi Sheng,

                 My question regarding 2. is that once I installed using Clickonce which folder location will the files be installed on my client machine will it be c:/program filer or where else?


    It won't be the Program Files folder. ClickOnce setups are for the installing user only, and they go in a user folder somewhere with a (I think) a random string in the folder name.

    Phil Wilson

    Monday, January 25, 2016 6:19 PM
  • Hi Phil,

              So are you suggesting to pick msi rather than clickonce? Yes I am using VS 2015. So how to install sqlite with MSI ?


    Can't say without knowing your full requirements. If you want to (for example) install a service, or an app for all users of the system, or shared files in the Common Files folder, then you need an MSI install.

    Phil Wilson

    Monday, January 25, 2016 6:20 PM
  • 1. How to deploy my sqlite. Currently my sqlite file is location in the debug folder. So first I have added the sqlite db file by just drag and drop on my project name and I can see the file in my VS 2015 file list. My confusion now is the build action some link say make it as content but other as embedded resource. Can you guys lets me know which is the right method to link it so I can deploy ?

    Don't make it an embedded resource. Make it a resource. It will be recognised as a dependency by most installers like the installer project.

    https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9

    2. Once I have installed where are my files location in the client machine I mean my .dll , exe and my sqlite db where are they are installed cause I would like to confirm if everything is installed properly.

    Depends which option you use.

    Clickonce deploys to the user's appdata into an obscured folder.

    If you use a different installer like those which generate msi then everything will usually go into a folder in program files unless you tell it otherwise. With the database you should do.  You should deploy it to a folder in appdata since you want any user to be able to write and create their database and program files has some pretty significant limitations.

    3. In future say I will make changes and create new version of application.

       a)In this version how to handle the db for existing user? 

    With clickonce that's a bit tricky because it installs your new file and renames the database by default.

    See this

    https://robindotnet.wordpress.com/2009/08/19/where-do-i-put-my-data-to-keep-it-safe-from-clickonce-updates/

       b)How to handle for the new user who dont have the software yet but there are going to be new user?

    They install your new version. It's usual to make each version a complete re-install effectively. That can be explicitly or implicitly with the installer removing the older version's stuff silently.

    4. How to just handle db updates say changes to some fields or adding some tables?

    Scripts are code are advisable.

    You need to potentially be able to move data around as well as add fields etc,

    It's common to have a "first run after update" mode or even a separate exe which runs.

    One option is  runonce in registry for this.

    Will clickonce be able to handle all these or should I use msi ? 

    Both can handle all these, in slightly different ways.

    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    Monday, January 25, 2016 8:06 PM
  • Hi Andy,

                Thank you for your detail points I am getting more clearer I got few more questions here.

    1. I will set my sqlite db as resource and copy to output I guess is copy always ? Ok I got another question when I got into the Project -> Application Properties then I click on the Publish . I dont see my db file in the application file why is such ? But if I set is as content then it appears in the Project -> Application Properties?

    2. The location is obscured folder? Can I investigate or go into that folder to see what is installed? I dont quite get your here "You should deploy it to a folder in appdata since you want any user to be able to write and create their database and program files has some pretty significant limitations." 

    3.  I read through your link. I like that idea. He is like suggesting to put my sqlite db into a separate folder which is a good idea. I saw this codes. Where should I run these codes?

    string localAppData =
      Environment.GetFolderPath(
      Environment.SpecialFolder.LocalApplicationData);
    string userFilePath
      = Path.Combine(localAppData, "MyCompany");
    
    if (!Directory.Exists(userFilePath))
        Directory.CreateDirectory(userFilePath);
    
    //if it's not already there, 
    //copy the file from the deployment location to the folder
    string sourceFilePath = Path.Combine(
      System.Windows.Forms.Application.StartupPath, "MyFile.txt");
    string destFilePath = Path.Combine(userFilePath, "MyFile.txt");
    if (!File.Exists(destFilePath))
        File.Copy(sourceFilePath, destFilePath);

    Current I create class for connection and I set this.

    string str = @"Data Source=mydb.sqlite3";

                SQLiteConnection con = new SQLiteConnection(str);
                con.Open();
                return con;

    So when I implement the above codes how should my location pointing codes here. Cause I need to point it to pick from the relevant location right? 

    4. I want to learn more on this "It's common to have a "first run after update" mode or even a separate exe which runs." When you say first run after update is a settings or some script? When you say separate exe means you like some updater file they double click then they delete is it ? 

    Tuesday, January 26, 2016 6:33 AM
  • Hi Andy,

                Any help on my previous post here? I manage do the clickonce publishing. Only issue I have I dont know whether my data file have been deploy I can check on that? I tried to do a search on my .sqlite file but could not locate it either? Any help where the file will be? I set as content and copy always? 

    Sunday, January 31, 2016 4:39 PM