PDA

View Full Version : Check if allowed to update using ASP and Trueupdate



nickw
06-03-2003, 01:26 PM
Hello All,

We are evaluating True update and are impressed so far! We have one issue that we require help with if possible.

OK, so....

We have an application, that stores a registration key in the users registry.

We want to send this key to a site using ASP, and get a TRUE / FALSE statement back. If the statement is True (the software is licenced), then I need to let the update continue. If it is False, then the update should display a dialog with a message and a close button.

This may sound simple to some here, but I am not a programmer, and I am trying to convince the programmers to get this software.

If someone can give specific details on how this is done (preferably on the Trueupdate and ASP side), I will be given the go ahead to get the package.

Thanks in advance.

Nick Whittome.

greenace
06-03-2003, 10:34 PM
This is actually quite simple. While I am just starting with TU, I have completed a few Setup Factory projects that use the very process you are describing.

To accomplish the task, use the Submit to Web option to submit data to your ASP page. The tricky part is the ASP code must handle the ASP delimeters ("<%" &amp; "%>") a little special. The best way I have found is to fool ASP by concatenating two strings together, i.e. "<" &amp; "%" to make the return info work correctly.

The its very simple to examine the returned value or values - and install if ok.

Somewhere under the Setup Factory Forum, I had listed some sample ASP code that might help. I'm not sure how to link to it, but if you can't find it, let me know.

nickw
06-20-2003, 06:22 AM
Hi Greenace...

Yes, I found your posts.... Thanks...

However, I could not find any demo ASP code that returns the results to Trueupdate. (I am not a programmer - LOL).

Maybe you could give more detail if you have time.

greenace
06-20-2003, 08:06 AM
Here is my ASP Code that returns a value.

<html>
<head>
<title><%=sTitle%></title>
</head>

<body>
<%
'Incoming Data From SetupFactory
'UserName map to AFUsername
'Password map to Password
'PName map to ProductName
'PVersion map to ProductVersion
'RegOwner map to RegOwner
'RegOrg map to RegOrganization
'OS map to OpSystem
'Domain map to LANDomain
'IP map to LANIP
'NIC map to LANNIC
'User map to LANUser
'InstallId map to InstallId
'Action map to Action
ClientsIP = Request.ServerVariables("Remote_Addr")

dim oktoinstall,returntext,edate,p1,p2,p3,p4,p5,CurDat e,InstallKey,Id,CIP

Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM users WHERE AfUsername ='" &amp; request("username") &amp; "'"
Conn.Open dsn
sql1 = "INSERT INTO installs(AFUsername, Action, ProductName, ProductVersion, RegOwner, RegOrganization, OPSystem, LANDomain, LANIP, LANNIC, LANUser, InstallId, ClientIP) Values('" &amp; request("Username") &amp; "', '" &amp; request("Action") &amp; "', '" &amp; request("PName") &amp; "', '" &amp; request("PVersion") &amp; "', '" &amp; request("RegOwner") &amp; "', '" &amp; request("RegOrg") &amp; "', '" &amp; request("OS") &amp; "', '" &amp; request("Domain") &amp; "', '" &amp; request("IP") &amp; "', '" &amp; request("NIC") &amp; "', '" &amp; request("User") &amp; "', '" &amp; request("InstallId") &amp; "', '" &amp; CIP &amp; "')"
conn.execute(sql1)

rs.open sql, conn
If NOT rs.EOF Then
CIP = ClientsIP

If trim(request("password")) = trim(rs("password")) Then
Select Case rs("activation")
Case"0"
oktoinstall = false
returntext = "The Margin Master Account has not been activated"
Case"1"
edate = cdate(rs("expiration"))
CurDate = cdate(Date())
if CurDate > edate then
oktoinstall = false
returntext = "The Margin Master Account has expired"
else

oktoinstall = true
returntext = "Valid Username Password and Activation"

Id = request("InstallID")
InstallKey = Mid(Id,7,1)+Mid(Id,1,1)+Mid(Id,6,1)+"-"+Mid(Id,2,1)+Mid(Id,5,1)+Mid(Id,3,1)
end if
Case"2"
oktoinstall = false
returntext = "The Margin Master Account has expired"
Case else
End Select
else
response.write request("password")
response.write rs("password")
oktoinstall = false
returntext = "The Password is invalid"
end if

Else
oktoinstall = false
returntext = "The UserName is invalid"
End If

rs.close
set rs = nothing

conn.close
set conn = nothing


p1 = "<SUF60>"+"%OKtoinstall%,%ReturnText%,%expdate%,%WebKey%</SUF60>"
p2 = "<"+"%OKtoinstall%"+">" &amp; oktoinstall &amp; "</%OKtoinstall%"+">"
p3 = "<"+"%ReturnText%"+">" &amp; returntext &amp; "</%ReturnText%"+">"
p4 = "<"+"%expdate%"+">" &amp; edate &amp; "</%expdate%"+">"
p5 = "<"+"%WebKey%"+">" &amp; InstallKey &amp; "</%WebKey%"+">"

response.write p1
response.write p2
response.write p3
response.write p4
response.write p5
%>

</body>
</html>

nickw
06-20-2003, 02:13 PM
Thanks Greenace...

Well, I was on the phone with Mark at Indigorose today, and between this and that we have it working!

THANKYOU!

I will post a new message with the solution to this forum soon.