ClickOnce deployment problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LukasMalik
    New Member
    • Jan 2008
    • 22

    ClickOnce deployment problem

    Hi all,

    my application (C# WinForm .NET 3.5) is distributed via ClickOnce deployment. Application should check for updates on our company web. Problem comes when any part of application has reference to assemblies which are not installed (registered) on curent machine. In solution are some library projects which works with MS Office and therefore has referenced some MS Office libraries. If no MS Office (2000/2003/2007) is installed on machine, automatized update download fails:

    "unable to install or run the application. The application requires assembly office version 12.0.0.0 be instaled in tge Global Assembly Cache first"

    That makes application useless now, if user has no MS Office instaled. I tried to solve this problem on several forums and in generally I get one possible solution - copy MS Office dll’s and add them to application files. I doubt MS Office dll’s are redistributable free.

    Is possible to choose which part of application will be installed with ClickOnce? I mean – user which has no Office installed wont install application extensions for work with Office and will avoid update problems.



    Thanks

    Lukas
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I *think* you can do something with the "distributi on groups" settings. I'm rather new to clickonce myself (only a few days) but I saw that you could put stuff in "groups". The defaults are like "always distribute" and "always exclude", but you could maybe investigate creating additional groups, and changing the dependancies?

    Comment

    • LukasMalik
      New Member
      • Jan 2008
      • 22

      #3
      ...at least you gave mi direction where to search :)

      I use ClickOnce whole development (more than year) but this is first problem which was not solved by myself after few clicks...

      I will be back in business if I force to ClickOnce deployment show user menu where will pick which - as you called that - groups will be installed.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Are they like seperate projects in a single solution?
        How do you have a program which can decide not to do part of itself?

        Comment

        • LukasMalik
          New Member
          • Jan 2008
          • 22

          #5
          Originally posted by Plater
          Are they like seperate projects in a single solution?
          How do you have a program which can decide not to do part of itself?
          I have solution with 24 projects. 1 is UI - Win Form project, other 23 are dll project referenced in first Win Form. One or two dll supports Office-related functions, which are useless if no Office version is installed. If they are called, COM Exception is thrown - there is missing reference to not existing library.

          .NET doesn't load an assembly until it is used. It works exactly how it should work. Untill Office-related function is called, application works fine, and afther this "ilegall call" is thrown an COM Exception which is caught with Message like "You dont have installed Microsoft Office"

          Problem comes during ClickOnce update. It does not allow to download this useless libraries and therefore update fails and no other project parts is downloaded.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Ok, now if those DLLs, that are projects in your solution, don't exist, does your program still run or does it throw errors as well?

            Comment

            • LukasMalik
              New Member
              • Jan 2008
              • 22

              #7
              Originally posted by Plater
              Ok, now if those DLLs, that are projects in your solution, don't exist, does your program still run or does it throw errors as well?
              If dont exist = are not present in app folder then yes. Program run until some of this DLL is needed to be used. That depends on user activity :)

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                Ok so I think you can do that grouping thing.
                Put the DLLs that want to use the Office stuff in a custom group.
                I noticed in the update that you can tell it to download optional groups:

                [code=c#]
                using System.Deployme nt.Application;

                if (ApplicationDep loyment.IsNetwo rkDeployed)
                {
                ApplicationDepl oyment deploy = ApplicationDepl oyment.CurrentD eployment;
                //deploy.Download FileGroup(group name)
                }
                [code]

                And on the same vein, you could use this:
                deploy.IsFileGr oupDownloaded(g roupname)
                to test if the DLL files were downloaded before trying to use those sections?

                There is bound to be more usefull tidbits in that namespace you could use too

                Comment

                Working...