What I did was hook in to the OnDetectUpdateBegin() event and create a thread 
to check a website, if the website reports that there is an update I enable a 
link on the welcome page that calls OnPlan(BOOTSTRAPPER_ACTION_UPDATE_REPLACE). 
I set the check link to include the bundle version e.g. Update 
Location="https://example.com/checkupgrade.asp?version=1.2.3.4” (this could do 
with being a formatted value so that you can use [WixBundleVersion]). The 
website returns the update URL and optionally the size of the download.

Most of the code was already in place so I just had to join the dots.

The thread code looks like this:
        // Load the update XML from a location url and parse it for an update.
        //
        // <?xml version="1.0" encoding="utf-8"?>
        // <Setup>
        //   <Upgrade Url="https://somewhere.co.uk/download/Setup.exe"; 
Size="123" />
        // </Setup>

        hr = XmlLoadDocumentFromFile(pThis->m_wzUpdateLocation, &pixd);
        BalExitOnFailure(hr, "Failed to load version check XML document.");

        hr = XmlSelectSingleNode(pixd, L"/Setup/Upgrade", &pNode);
        BalExitOnFailure(hr, "Failed to select upgrade node.");

        if (S_OK == hr)
        {
            hr = XmlGetAttributeEx(pNode, L"Url", &sczUpdateUrl);
            BalExitOnFailure(hr, "Failed to get url attribute.");

            hr = XmlGetAttributeLargeNumber(pNode, L"Size", &qwSize);

            pThis->m_fUpdate = (sczUpdateUrl && *sczUpdateUrl);
       }

        if (pThis->m_fUpdate)
        {
            BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Update available, url: 
%ls; size: %I64u.", sczUpdateUrl, qwSize);
            pThis->m_pEngine->SetUpdate(NULL, sczUpdateUrl, qwSize, 
BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE, NULL, 0);
            ThemeControlEnable(pThis->m_pTheme, WIXSTDBA_CONTROL_UPGRADE_LINK, 
TRUE);
        }
        else
        {
            BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "No update available.");
        }

I’ll try and create a fork for this tonight.

Neil

From: Rob Mensching [mailto:[email protected]]
Sent: 19 February 2013 15:00
To: Windows Installer XML toolset developer mailing list
Subject: Re: [WiX-devs] WixStdBA and bundle self updates

Implementation stopped in the engine when I couldn't decide whether the engine 
should be doing that much work or not. Was the check on the internet something 
the BA should do or should the engine provide a default implementation. Since I 
didn't have an immediate answer, I fell back to one of the original Burn design 
guidelines: "If it can be done in the BA, let the BA do it."

This is something that can be revisited in WiX v3.8 or WiX v4.0.

Note: that original design guideline was in place when there was an enormous 
amount of work that had to be accomplished in Burn. It is still a reasonable 
good guideline but will change as Burn and the BA relationship matures, I'm 
sure. <smile/>

On Mon, Jan 14, 2013 at 8:33 AM, Neil Sleightholm 
<[email protected]<mailto:[email protected]>> wrote:
I have implemented it my BA http://wixextba.codeplex.com/ (you need to download 
the source to get the compiled version). If you want to know more please start 
a discussion on codeplex.

Neil

From: Hoover, Jacob 
[mailto:[email protected]<mailto:[email protected]>]
Sent: 14 January 2013 16:23
To: Windows Installer XML toolset developer mailing list
Subject: [WiX-devs] WixStdBA and bundle self updates

  Is there any information on the state of self-updates for WixStdBA? I see a 
partial implementation inside of DetectUpdate in detect.cpp and 
psuedobundle.cpp, but it is commented out.  I assume there wasn’t time to 
complete it so it was pulled. Are there any plans to finish this in 3.8, or do 
we have any documentation on the desired end result? I looked at what was done 
in Wix’s own managed BA, and the only question I am pondering is should this 
exist in the BA or in the engine?
  I assume the same feed would be used by the engine for bundle update 
detection as what would be used by ambient, which appears to be a possible 
option to integrate a “Check for updates” feature from within an app deployed 
with burn.


Thanks,
Jacob


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET<http://ASP.NET>, C# 2012, HTML5, 
CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
WiX-devs mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/wix-devs

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to