Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Modify ClickOnce publish page

Posted on 2007-08-20
10
Medium Priority
?
1,545 Views
Last Modified: 2013-11-05
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
0
Comment
  • 6
  • 4
10 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19729098
JS cannot read a server directory.
What it can do is read a (manifest ) file
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19729104
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
 
LVL 48

Author Comment

by:Wayne Taylor (webtubbs)
ID: 19729124
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19729159
Absolutely

xmlhttp request to the resque...

Do you use prototype.js?

0
 
LVL 48

Author Comment

by:Wayne Taylor (webtubbs)
ID: 19729177
No. There are no js files involved at all. All is contained in publish.htm.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19729184
<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
 
LVL 48

Author Comment

by:Wayne Taylor (webtubbs)
ID: 19729260
Thanks. It doesn't seem to be working. Can you take a look at http://quickee.dabas.net.au/test.htm
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19729358
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
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 19729389
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
 
LVL 48

Author Comment

by:Wayne Taylor (webtubbs)
ID: 19729572
Awesome! That works.

Many Thanks,

Wayne
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question