|
-
Oct 9th, 2009, 03:30 PM
#1
Thread Starter
Hyperactive Member
Read MSI version
I am trying to set up a ASP web page to automatically show the Current version and Date of an MSI package that I uploaded to my web site.
The code works in VB.NET but when I try to convert it to ASP, I get an error on the OpenView. Any idea?
Code:
<%
dim f, wi, fs, db, vu, fmt, full, sql
full = Server.MapPath("./pkg.msi")
set wi = Server.CreateObject("WindowsInstaller.Installer")
set fs = Server.CreateObject("Scripting.FileSystemObject")
sql = "SELECT * FROM property WHERE Property='ProductVersion'"
if fs.FileExists(full) = True then
set db = wi.OpenDatabase(full, 0)
set vu = db.Openview(sql)
vu.execute()
Response.Write("Version=" & VU.fetch)
vu.close()
set f = fs.GetFile(full)
dt = f.DateLastModified
fmt = Year(dt) & "/" & right(100+Month(Dt),2) & "/" & right(100+Day(dt),2) & " " & right(100+Hour(dt),2) & ":" & right(100+Minute(dt),2) & ":" & right(100+Second(dt),2)
Response.Write("Date=" & fmt)
end if
%>
-
Oct 13th, 2009, 01:25 PM
#2
Addicted Member
Re: Read MSI version
hi,
in your code stands:
Code:
sql = "SELECT * FROM property WHERE Property='ProductVersion'"
I assume that ProductVersion is a variable?
what if you try:
Code:
sql = "SELECT * FROM property WHERE Property=" & ProductVersion
grtz,
Paul
-
Oct 13th, 2009, 01:31 PM
#3
Thread Starter
Hyperactive Member
Re: Read MSI version
No, I have to give it the name of the Property to extract, so I can get its current value.
This code works in VB.NET, it is just that I don't know why it fails in ASP.NET
I am not an expert with ASP.NET, it is the first time I try it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|