Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to work with ClickOnce for automatic updation

how to work with ClickOnce for automatic updation

Scheduled Pinned Locked Moved C#
announcementhelptutorial
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pashitech
    wrote on last edited by
    #1

    hi all i want to update my application with a prompt for that. i found Clickonce is very good, and tried alot to understand, see could able to publish and make the new versions, but my requirement is whenver user opens my applicaions and connected to internet i need to promt him saying u r working with olderversio(1.0 and current version 3.0 is available) if user clicks ok it should be updated please help me how to do so thnx in advance

    prashanth, s/w Engineer, Syfnosys.

    R R 2 Replies Last reply
    0
    • P pashitech

      hi all i want to update my application with a prompt for that. i found Clickonce is very good, and tried alot to understand, see could able to publish and make the new versions, but my requirement is whenver user opens my applicaions and connected to internet i need to promt him saying u r working with olderversio(1.0 and current version 3.0 is available) if user clicks ok it should be updated please help me how to do so thnx in advance

      prashanth, s/w Engineer, Syfnosys.

      R Offline
      R Offline
      rvlemmings
      wrote on last edited by
      #2

      This info must be available in lots of places, but here it goes (in short)... To publish the initial application: 1. Right click on the Project in solution explorer. Click Properties. Click the Publish tab. 2. Enter the location you want to publish to in 'Publishing location' 3. Click the 'Updates' button. 4. Check the 'Application should check for updates' checkbox. 5. Check the 'Before the application starts' radio button. 6. Click OK to close the dialog. 7. Back on the main screen, select 'The application is available offline as well' 8. Enter your initial publish version under 'Publish Version' 9. Click the 'Publish Now' button. To publish an update: If you want to publish an optional update, just increment the 'Publish Version' and click the 'Publish Now' button. When starting the application the user will be prompted if the update should be installed. The user has the option to skip the update. If you want to publish a required update, increment the 'Publish Version'; then, click the 'Updates' button. In the dialog, check the 'Specify a minimum required version for...' checkbox. Enter the same version you just entered in 'Publish Version'. Click OK to close the dialog. On the main screen, click the 'Publish Now' button. The update will automatically install as soon as the user starts the application. Hope this helps, Roel

      P 1 Reply Last reply
      0
      • R rvlemmings

        This info must be available in lots of places, but here it goes (in short)... To publish the initial application: 1. Right click on the Project in solution explorer. Click Properties. Click the Publish tab. 2. Enter the location you want to publish to in 'Publishing location' 3. Click the 'Updates' button. 4. Check the 'Application should check for updates' checkbox. 5. Check the 'Before the application starts' radio button. 6. Click OK to close the dialog. 7. Back on the main screen, select 'The application is available offline as well' 8. Enter your initial publish version under 'Publish Version' 9. Click the 'Publish Now' button. To publish an update: If you want to publish an optional update, just increment the 'Publish Version' and click the 'Publish Now' button. When starting the application the user will be prompted if the update should be installed. The user has the option to skip the update. If you want to publish a required update, increment the 'Publish Version'; then, click the 'Updates' button. In the dialog, check the 'Specify a minimum required version for...' checkbox. Enter the same version you just entered in 'Publish Version'. Click OK to close the dialog. On the main screen, click the 'Publish Now' button. The update will automatically install as soon as the user starts the application. Hope this helps, Roel

        P Offline
        P Offline
        pashitech
        wrote on last edited by
        #3

        Thnx alot Mr.Roel I found ur help on click once is useful, but here i have a doubt about my current Error: INVALIDDEPLOYMENTEXEPTION, saying "Application in not installed" Here i have taken a button[Update] and when user clicks the buttion the functionality should checks the updated version and if available it should download the latest version for that my code is,, in Buttion private void button1_Click(object sender, EventArgs e) { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment; bool update = appDeploy.CheckForUpdate(); if (update) { UpdateCheckInfo updateInfo = appDeploy.CheckForDetailedUpdate(); string version = updateInfo.AvailableVersion.ToString(); bool updateRequired = updateInfo.IsUpdateRequired; string minVersion = ""; if (updateInfo.MinimumRequiredVersion!=null) minVersion = updateInfo.MinimumRequiredVersion.ToString(); bool updateAvail = updateInfo.UpdateAvailable; long footprint = updateInfo.UpdateSizeBytes; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Update Version: {0}\r\n", version); sb.AppendFormat("Minimum Version: {0}\r\n", minVersion); sb.AppendFormat("Update Required: {0}\r\n", updateRequired); sb.AppendFormat("Update Available: {0}\r\n", updateAvail); sb.AppendFormat("Update Footprint: {0} bytes\r\n", footprint); MessageBox.Show(sb.ToString()); if (updateAvail) { bool updated = appDeploy.Update(); if (updated) Application.Restart(); } } else MessageBox.Show("No updates are available."); } else { MessageBox.Show("This application was not launched using ClickOnce. Cannot perform update."); } } in PageLoad private void Form1_Load(object sender, EventArgs e) { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment appDep

        R 1 Reply Last reply
        0
        • P pashitech

          Thnx alot Mr.Roel I found ur help on click once is useful, but here i have a doubt about my current Error: INVALIDDEPLOYMENTEXEPTION, saying "Application in not installed" Here i have taken a button[Update] and when user clicks the buttion the functionality should checks the updated version and if available it should download the latest version for that my code is,, in Buttion private void button1_Click(object sender, EventArgs e) { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment; bool update = appDeploy.CheckForUpdate(); if (update) { UpdateCheckInfo updateInfo = appDeploy.CheckForDetailedUpdate(); string version = updateInfo.AvailableVersion.ToString(); bool updateRequired = updateInfo.IsUpdateRequired; string minVersion = ""; if (updateInfo.MinimumRequiredVersion!=null) minVersion = updateInfo.MinimumRequiredVersion.ToString(); bool updateAvail = updateInfo.UpdateAvailable; long footprint = updateInfo.UpdateSizeBytes; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Update Version: {0}\r\n", version); sb.AppendFormat("Minimum Version: {0}\r\n", minVersion); sb.AppendFormat("Update Required: {0}\r\n", updateRequired); sb.AppendFormat("Update Available: {0}\r\n", updateAvail); sb.AppendFormat("Update Footprint: {0} bytes\r\n", footprint); MessageBox.Show(sb.ToString()); if (updateAvail) { bool updated = appDeploy.Update(); if (updated) Application.Restart(); } } else MessageBox.Show("No updates are available."); } else { MessageBox.Show("This application was not launched using ClickOnce. Cannot perform update."); } } in PageLoad private void Form1_Load(object sender, EventArgs e) { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment appDep

          R Offline
          R Offline
          roel_v
          wrote on last edited by
          #4

          In which line does this error occur? Roel

          R 1 Reply Last reply
          0
          • R roel_v

            In which line does this error occur? Roel

            R Offline
            R Offline
            roel_v
            wrote on last edited by
            #5

            Are you sure you selected 'The application is available offline as well' on the publish tab when you published it? Roel

            P 1 Reply Last reply
            0
            • P pashitech

              hi all i want to update my application with a prompt for that. i found Clickonce is very good, and tried alot to understand, see could able to publish and make the new versions, but my requirement is whenver user opens my applicaions and connected to internet i need to promt him saying u r working with olderversio(1.0 and current version 3.0 is available) if user clicks ok it should be updated please help me how to do so thnx in advance

              prashanth, s/w Engineer, Syfnosys.

              R Offline
              R Offline
              roel_v
              wrote on last edited by
              #6

              Please post your replies on the forum instead of direct email, for the benefit of other users. You may want to check this out too: http://blogs.msdn.com/shawnfa/archive/2006/01/20/514411.aspx[^]

              1 Reply Last reply
              0
              • R roel_v

                Are you sure you selected 'The application is available offline as well' on the publish tab when you published it? Roel

                P Offline
                P Offline
                pashitech
                wrote on last edited by
                #7

                yes i am sure, i've selected 'The application is available offline as well' and can u please help me , how to work with Deployment.[ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;] i couldn't create instance to ApplicationDeployment , please tell me whatz all the credentials needed to create an instance to ApplicationDeployment . thnx in advance

                prashanth, s/w Engineer, Syfnosys.

                R 1 Reply Last reply
                0
                • P pashitech

                  yes i am sure, i've selected 'The application is available offline as well' and can u please help me , how to work with Deployment.[ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;] i couldn't create instance to ApplicationDeployment , please tell me whatz all the credentials needed to create an instance to ApplicationDeployment . thnx in advance

                  prashanth, s/w Engineer, Syfnosys.

                  R Offline
                  R Offline
                  roel_v
                  wrote on last edited by
                  #8

                  The ApplicationDeployment class does not have a constructor, so you can't create an instance of it. The only way to get an instance is to use the static CurrentDeployment property. No offense, but I do suggest you start looking at the documentation rather than asking basic questions like this on the forum. The forum really is meant to get answers to things you can't readily figure out from the documentation. The entire .NET framework documentation is available online. See for example: http://msdn2.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.currentdeployment.aspx[^] Best regards, Roel

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups