Link to home
Start Free TrialLog in
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)Flag for Australia

asked on

Modify ClickOnce publish page

Hi Guys,

I'm attempting to recreate the deployment page for QuickEE - http://quickee.dabas.net.au/publish.htm

All is going well, but one thing has me stumped. How can I determine the latest available version number (currently 1.1.0.68)? Within the same directory, there are a number of folders and files. There are a number of files, with the naming format 'QuickEE_1_1_0_68.application'. Is there a way to check each of these files and return the latest version using JavaScript?

Cheers,

Wayne
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

JS cannot read a server directory.
What it can do is read a (manifest ) file
Cant you dump a
version.js
in there which just does a

document.write('1_1_0_68')

and which is updated by your deployment package?
Avatar of Wayne Taylor (webtubbs)

ASKER

Thanks, mplungjan.

Is it possible to read http://quickee.dabas.net.au/QuickEE.application with js? It contains this....

<assemblyIdentity name="QuickEE.application" version="1.1.0.68" publicKeyToken="ab611e03a95fb421" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

Wayne
Absolutely

xmlhttp request to the resque...

Do you use prototype.js?

No. There are no js files involved at all. All is contained in publish.htm.
<script>
var req;
function retrieveURL(url) {
  if (window.XMLHttpRequest) { // Non-IE browsers
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) { // IE
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req) {
    //Define "callback" function
    req.onreadystatechange = processStateChange;
    try {
      req.open("GET", url, true);
      req.send('');
    } catch (e) {
      alert(e);
    }
  } else {
    document.getElementById("version").innerHTML = "XMLHTTPRequest not supported";
  }
}
 
function processStateChange() {
  if (req.readyState==4) {
    if (req.status == 200) { // OK response
      var t = req.responseText;
      version = t.substring(t.indexOf('version="')+9,t.indexOf('" publicKeyToken'))
      document.getElementById("version").innerHTML = version;
    }
}
</script>
</head>
<body onLoad="retrieveURL('QuickEE.application')">
Version: <span id="version"></span>
Thanks. It doesn't seem to be working. Can you take a look at http://quickee.dabas.net.au/test.htm
Missing } after function body


function processStateChange() {

  if (req.readyState==4) {

    if (req.status == 200) { // OK response

      var t = req.responseText;

      version = t.substring(t.indexOf('version="')+9,t.indexOf('" publicKeyToken'))

      document.getElementById("version").innerHTML = version;

    }

}


has to be


function processStateChange() {
  if (req.readyState==4) {
    if (req.status == 200) { // OK response
      var t = req.responseText;
      version = t.substring(t.indexOf('version="')+9,t.indexOf('" publicKeyToken'))
      document.getElementById("version").innerHTML = version;
    }
  }
}

and you MUST call the retreive in the onLoad or after you define the span since it does not exist where you call it now
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome! That works.

Many Thanks,

Wayne