1. Kwadwo Boahene
  2. PowerBuilder
  3. Monday, 4 May 2020 19:05 PM UTC

We are trying to switch our PB deploy app process using github like other apps (non powerbuilder). Has anyone done this before - using Github? If so I could use some help with the steps. There is a squirrel.dll that I am supposed to reference. Any idea on how to do that? I am told the referencing will lead to knowing whether a new version is available of install etc, etc. Researching I came across the code below in C#. Is there a way I can call this in PB or convert it to Powerscript? I am using Powerbuilder 2017 R2.

 

//////////////////

 

private void InstallUpdateSync()
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        Boolean updateAvailable = false;
        ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;

        try
        {
            updateAvailable = ad.CheckForUpdate();
        }
        catch (DeploymentDownloadException dde)
        {
            // This exception occurs if a network error or disk error occurs
            // when downloading the deployment.
            MessageBox.Show("The application cannt check for the existence of a new version at this time. \n\nPlease check your network connection, or try again later. Error: " + dde);
            return;
        }
        catch (InvalidDeploymentException ide)
        {
            MessageBox.Show("The application cannot check for an update. The ClickOnce deployment is corrupt. Please redeploy the application and try again. Error: " + ide.Message);
            return;
        }
        catch (InvalidOperationException ioe)
        {
            MessageBox.Show("This application cannot check for an update. This most often happens if the application is already in the process of updating. Error: " + ioe.Message);
            return;
        }

        if (updateAvailable)
        {
            try
            {
                ad.Update();
                MessageBox.Show("The application has been upgraded, and will now restart.");
                Application.Restart();
            }
            catch (DeploymentDownloadException dde)
            {
                MessageBox.Show("Cannot install the latest version of the application. Either the deployment server is unavailable, or your network connection is down. \n\nPlease check your network connection, or try again later. Error: " + dde.Message);
            }
            catch (TrustNotGrantedException tnge)
            {
                MessageBox.Show("The application cannot be updated. The system did not grant the application the appropriate level of trust. Please contact your system administrator or help desk for further troubleshooting. Error: " + tnge.Message);
            }
        }
    }
}


Thnaks,
Kwadwo


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.