ylazy / nativeapplicationupdater

Automatically exported from code.google.com/p/nativeapplicationupdater
0 stars 1 forks source link

Url does not support relative paths #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
<update xmlns="http://ns.riaspace.com/air/framework/update/description/1.1">
    <!-- Win update -->
    <exe>
        <version>7.0</version>
        <url>http://localhost:8096/posinstall/TechPos.exe</url>
        <description>
            <![CDATA[
                * This a Win update 
                ]]>
        </description>
    </exe>

problem
url does not support relative paths

I want to modify:
updatePackageURL = 
updateDescriptor.UPDATE_XMLNS_1_0::urls.UPDATE_XMLNS_1_1::[installerType];

if(updatePackageURL.indexOf("http")==-1 || XX || XX)
 updatePackageURL  = updateURL.substring(XX,XX)+fileName;

Original issue reported on code.google.com by liucf.m...@gmail.com on 5 Mar 2011 at 7:18

GoogleCodeExporter commented 8 years ago
To expand on the original comment, an adequate solution for me was to assume 
that the URL property of the XML file is a simple filename, NOT a relative 
path, and the EXE or other binary must reside in the same folder as the XML. 
Add the following right after the logic that sets updateVersion, 
updateDescription, and updatePackageURL, which in version 0.5.1 would be around 
line 245:

// If update URL is not an absolute URL, assume it is a simple filename
if(updatePackageURL.indexOf("http") == -1) {
    updatePackageURL = updateURL.substring(0, updateURL.lastIndexOf("/") + 1) + updatePackageURL;
}

Original comment by knopp.j...@gmail.com on 14 Jun 2011 at 1:20