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
LVL 48
Wayne Taylor (webtubbs)Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
JS cannot read a server directory.
What it can do is read a (manifest ) file
0
Michel PlungjanIT ExpertCommented:
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?
0
Wayne Taylor (webtubbs)Author Commented:
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
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Michel PlungjanIT ExpertCommented:
Absolutely

xmlhttp request to the resque...

Do you use prototype.js?

0
Wayne Taylor (webtubbs)Author Commented:
No. There are no js files involved at all. All is contained in publish.htm.
0
Michel PlungjanIT ExpertCommented:
<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>
0
Wayne Taylor (webtubbs)Author Commented:
Thanks. It doesn't seem to be working. Can you take a look at http://quickee.dabas.net.au/test.htm
0
Michel PlungjanIT ExpertCommented:
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
0
Michel PlungjanIT ExpertCommented:
Here is a changed version
function processStateChange() {
  if (req.readyState==4) {
    if (req.status == 200) { // OK response
      var t = req.responseText;
      alert(req.responseHtml)
      var startPos = t.indexOf('version="',50)+9;
      var endPos = t.indexOf('" publicKeyToken');
      alert(startPos+'/'+endPos)
      var ver = t.substring(startPos,endPos)
      document.getElementById("version").innerHTML = ver;
    }
  }
}


we COULD parse the xml, but then we need to have the server send text/xml headers and/or create a dom document from the text returned
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wayne Taylor (webtubbs)Author Commented:
Awesome! That works.

Many Thanks,

Wayne
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.