hi folks,
i was just wondering if anyone could let me know what is the best approach to creating a client specific validation module?
really appreciate any help here?

any samples or links to samples would be gold dust!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi,
Take a look at one of the cube (.cub) files in your Orca dir, open it in Orca. Darice.cub – for example runs several vbs as custom actions from the binary table, they appear to be sequenced in the _ICESequence table. If you write out the contents of the vbs in the binary table it should give you an idea on how to make your own.

My custom cub consists of only VBS – Seeing as my VBS is v poor, I ‘liberated’ it from a previous employer and mod’ed it for my own needs.

ICE cube, get it? 
Answered 03/23/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
2
Here is an simple example checking registry table for c:\

Function wdICE01()
On Error Resume Next

Set recInfo=Installer.CreateRecord(1)
If Err <> 0 Then
wdICE01 = 1
Exit Function
End If

'Give description of test
recInfo.StringData(0)="wdICE01" & Chr(9) & "3" & Chr(9) & "wdICE01 - Performs a non case sensitive search for C:\ hard coded into the Registry table "
Message &h03000000, recInfo

'Give creation data
recInfo.StringData(0)="wdICE01" & Chr(9) & "3" & Chr(9) & "Created 09/11/06. Last Modified 18/03/07."
Message &h03000000, recInfo

'Is there a Registry table in the database?
iStat = Database.TablePersistent("Registry")
If 1 <> iStat Then
recInfo.StringData(0)="wdICE01" & Chr(9) & "3" & Chr(9) & "'Registry' table missing. wdICE01 cannot continue its validation."
Message &h03000000, recInfo
wdICE01 = 1
Exit Function
End If

'process table
Set view=Database.OpenView("SELECT Value FROM Registry")
view.Execute

If Err <> 0 Then
recInfo.StringData(0)="wdICE01" & Chr(9) & "0" & Chr(9) & "view.Execute_1 API Error"
Message &h03000000, recInfo
wdICE01=1
Exit Function
End If

Do
Set rec=view.Fetch
If rec Is Nothing Then Exit Do

'check for permanent attribute.
If InStr(1,rec.StringData(1),"c:\",1) > 0 Then
rec.StringData(0)="wdICE01" & Chr(9) & "2" & Chr(9) & "Registry: [1] is hard coded into registry." & Chr(9) & "" & Chr(9) & "Registry" & Chr(9) & "Registry" & Chr(9) & "[1]"
Message &h03000000,rec
End If
Loop

'Return iesSuccess
wdICE01 = 1
Exit Function


End Function


How to add ICE to darice.cub.. ice.pdf

Script needs updating as its not switching focus to correct row when you double click on ICE...
Answered 03/23/2007 by: Tone
Second Degree Blue Belt

Please log in to comment
2
Another similar example, this one does switch focus to problem row and has some comments,

Example output:
wdICE02 WARNING Path C:\Program Files\Test\Config is hard coded in config key within testapp.ini
wdICE02 WARNING Path c:\progra~1\Files\Test\DB is hard coded in data1 key within testapp.ini


Function wdICE02()
On Error Resume Next

Set recInfo=Installer.CreateRecord(1)
If Err <> 0 Then
wdICE02 = 1
Exit Function
End If

'Give description of test
recInfo.StringData(0)="wdICE02" & vbTab & "3" & vbTab & "wdICE02 - Performs a non case sensitive search for C:\ hard coded into the IniFile table "
Message &h03000000, recInfo

'Give creation data
recInfo.StringData(0)="wdICE02" & vbTab & "3" & vbTab & "Created 23/03/07. Last Modified 23/03/07."
Message &h03000000, recInfo

'Is there a IniFile table in the database?
iStat = Database.TablePersistent("IniFile")
If 1 <> iStat Then
recInfo.StringData(0)="wdICE02" & vbTab & "3" & vbTab & "'IniFile' table missing, wdICE02 cannot continue its validation."
Message &h03000000, recInfo
wdICE02 = 1
Exit Function
End If

'process table
' [1] [2] [3] [4]
Set View = Database.OpenView("SELECT `IniFile`,`FileName`,`Key`,`Value` FROM `IniFile`")
view.Execute

If Err <> 0 Then
recInfo.StringData(0)="wdICE02" & vbTab & "0" & vbTab & "view.Execute_1 API Error"
Message &h03000000, recInfo
wdICE02=1
Exit Function
End If

Do
Set rec=view.Fetch
If rec Is Nothing Then Exit Do

'check for hardcoded string.
If InStr(1,rec.StringData(4),"c:\",1) > 0 Then
'Name of ICE <tab> Message Type <tab> Description <tab> Help URL or location <tab> Table Name <tab> Column Name <tab> Primary Key <tab> Primary Key <tab> Primary Key
'(repeat for as many primary keys as needed) http://msdn2.microsoft.com/en-us/library/aa369205.aspx
rec.StringData(0)="wdICE02" & vbTab & "2" & vbTab & "Path [4] is hard coded in [3] key within [4]" & vbTab & "" & vbTab & "IniFile" & vbTab & "IniFile" & vbTab & "[1]"
Message &h03000000,rec
End If
Loop

'Return iesSuccess
wdICE02 = 1
Exit Function


End Function
Answered 03/24/2007 by: Tone
Second Degree Blue Belt

Please log in to comment
0
forgot to reply to this. thx a mil for the examples guys, total heroes.[:-]
Answered 07/03/2007 by: misk
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity