none
Can I create a directory structure in a ClickOnce Installation ? RRS feed

  • Question

  • Dear Group,

    I'd like to create a Click-Once application (I have previously used a Windows Install Project inside Visual Studio).

    Can I create directory structures in the Click-Once destination folder? I.e. I'd like to keep my existing structure of installed directories, i.e. a doc , images, bin directories etc so that the many files I need to install are in a neat structure.

    I can specify this in a Install (.msi)Project, but I do not seem to see the same functionality when creating a Click Once project.

    thanks

    Simon Michnowicz


    Simon Michnowicz Senior Software Engineer Australian Proteomics Computational Facility
    mardi 15 mars 2011 01:57

Réponses

  • Hi Simon_Michnowicz,

    We just need to modify the Publish version number when we build a new version of the product, then the application will check this version number to ensure if there's need a update.

    http://www.vbdotnetforums.com/net-framework/13740-assemblyversion-vs-assemblyfileversion.html

    Assembly version, a.k.a. product version is used by CLR when loading dependent assemblies. As in .NET 1.X, you can see/change the ProductVersion in assembly manifest by using [assembly:AssemblyVersion("2.1.6.432")] attribute. In VS2005, there is now UI for the ProductVersion --

     

    Project Properties->Application Tab->Assembly Information.

     

    Programmatically, you can get this version by calling

    Code:

    Application.ProductVersion

     

    File version existed in VS2003, although some people didn't know about it because it wasn't automatically added to AssemblyInfo.vb. AssemblyFileVersion attribute is what is shown in Version tab in Windows Explorer when you look at an assemblies properties. If you want compatibility, don't change the AssemblyVersion, but use the AssemblyFileVersion to track your builds and versions; only increment the AssemblyVersion when you are breaking compatibility and want to force a recompile and

    allow side-by-side execution.

     

    Note: if you exclude the AssemblyFileVersion, then the value is set to the same as AssemblyVersion. Check out FileVersionInfo class for more info.

     

    Finally, with ClickOnce, we now have the deployment (a.k.a. publish version). This is what's used to figure out if the client installation is up-to-date or a newer version is available. Programmatically, you can get this version using

    Code:

    System.Deployment.ApplicationDeployment.CurrentDeployment.CurrentVersion

     

    You can also check whether or not deployment was implemented using ClickOnce ....

    Code:

    System.Deployment.ApplicationDeployment.IsNetworkDeployed

     

    Have a nice day!

     


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    lundi 21 mars 2011 10:38
    Modérateur
  • Hi Simon_Michnowicz,

    You can follow the below steps, it works for me for this request:

    1. Add a folder to your project, by right click on the project, then Add a New Folder.

    2. Add a Existing item(a picture or others) to this folder.

    Then you need note the following settings:

    You can open the Publish page to see the application files which you will publish with your application:

    Then you can publish your application, now.

    It will also keep the file system structure in your application folder.

     

    If there's any concern, please feel free to let us know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    jeudi 17 mars 2011 11:59
    Modérateur

Toutes les réponses

  • Hi Simon_Michnowicz,

    You can follow the below steps, it works for me for this request:

    1. Add a folder to your project, by right click on the project, then Add a New Folder.

    2. Add a Existing item(a picture or others) to this folder.

    Then you need note the following settings:

    You can open the Publish page to see the application files which you will publish with your application:

    Then you can publish your application, now.

    It will also keep the file system structure in your application folder.

     

    If there's any concern, please feel free to let us know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    jeudi 17 mars 2011 11:59
    Modérateur
  • Mike,

    thanks for that, it helped me a lot!

     

    Just one more question, when updating a single file, is it necessary to update the AssemblyVersion or AssemblyFileVersion numbers in the program, or is it sufficient to just update the "Publish Version" number?  is there any need (or tool) to correlate the two different numbers?

     

    thanks

    Simon Michnowicz


    Simon Michnowicz Senior Software Engineer Australian Proteomics Computational Facility
    lundi 21 mars 2011 05:29
  • Hi Simon_Michnowicz,

    We just need to modify the Publish version number when we build a new version of the product, then the application will check this version number to ensure if there's need a update.

    http://www.vbdotnetforums.com/net-framework/13740-assemblyversion-vs-assemblyfileversion.html

    Assembly version, a.k.a. product version is used by CLR when loading dependent assemblies. As in .NET 1.X, you can see/change the ProductVersion in assembly manifest by using [assembly:AssemblyVersion("2.1.6.432")] attribute. In VS2005, there is now UI for the ProductVersion --

     

    Project Properties->Application Tab->Assembly Information.

     

    Programmatically, you can get this version by calling

    Code:

    Application.ProductVersion

     

    File version existed in VS2003, although some people didn't know about it because it wasn't automatically added to AssemblyInfo.vb. AssemblyFileVersion attribute is what is shown in Version tab in Windows Explorer when you look at an assemblies properties. If you want compatibility, don't change the AssemblyVersion, but use the AssemblyFileVersion to track your builds and versions; only increment the AssemblyVersion when you are breaking compatibility and want to force a recompile and

    allow side-by-side execution.

     

    Note: if you exclude the AssemblyFileVersion, then the value is set to the same as AssemblyVersion. Check out FileVersionInfo class for more info.

     

    Finally, with ClickOnce, we now have the deployment (a.k.a. publish version). This is what's used to figure out if the client installation is up-to-date or a newer version is available. Programmatically, you can get this version using

    Code:

    System.Deployment.ApplicationDeployment.CurrentDeployment.CurrentVersion

     

    You can also check whether or not deployment was implemented using ClickOnce ....

    Code:

    System.Deployment.ApplicationDeployment.IsNetworkDeployed

     

    Have a nice day!

     


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    lundi 21 mars 2011 10:38
    Modérateur
  • I have a ClickOnce addin for Microsoft Office that I needed to make an .MSI for (in order to support installation for all users).  

    I used to set the ClickOnce publish version before building, and then call

    ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();

    at runtime to display the version info in the GUI.  But this throws an error when I changed deployment from ClickOnce to MSI (obviously).  So if I read correctly is the recommended solution to also set the ApplicationTab->Assembly Information Button->File Version textbox on my addin's properties?  Keep in mind I have many class libraries in my solution and I don't want to have to set File Version for every library, just my addin project.

    mercredi 18 septembre 2013 23:02