Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

modifying the msi at runtime to display errors


2 replies to this topic

BasHamer

BasHamer
  • Members
  • 1 posts

Posted 03 January 2005 - 21:25

Ok, I'm working on modifying the msi database and populating things at runtime. Now I've been able to get my combo boxes populated but for some reason I can't get my error boxes not to show up.

This is the code that I'm using.


Code:
CODE
if TotalHomes > 0 then
     Set errortextlist = Database.OpenView("SELECT * FROM `ControlCondition`")
     errortextlist.Execute
     Set reclist = Installer.CreateRecord(4)
     reclist.StringData(1)  = "GambroOracle"
     reclist.StringData(2) = "OracleErrorProduction"
     reclist.StringData(3)  = "Hide"
     reclist.StringData(4)  = "NOT true"
     errortextlist.Modify msiViewModifyInsertTemporary, reclist  
     Set reclist = Installer.CreateRecord(4)
     reclist.StringData(1)  = "GambroOracle"
     reclist.StringData(2) = "OracleErrorTraining"
     reclist.StringData(3)  = "Hide"
     reclist.StringData(4)  = "NOT false"
     errortextlist.Modify msiViewModifyInsertTemporary, reclist
     Set reclist = Installer.CreateRecord(4)
     reclist.StringData(1)  = "GambroOracle"
     reclist.StringData(2) = "OracleErrorValdation"
     reclist.StringData(3)  = "Hide"
     reclist.StringData(4)  = "NOT yes"
     errortextlist.Modify msiViewModifyInsertTemporary, reclist
     errortextlist.close
 End if

The error is as follows:
Internal Error 2835. 3490, GambroOracle

Gambro Oracle is the dialog that has the OracleErrorXXX text boxes.

anyone have any idea how I can get rid of this error ?

Oh, if I change all the third atributes to a single string I no longer get the error. so If I put in "true" "yes" or any other single word in there the problem doesn't show. Then again it doesn't make the text box hidden either.

I also tried to do it an other way;


Code:
CODE
Set propertieslist = Database.OpenView("SELECT * FROM `Property`")
     propertieslist.Execute
     Set reclist = Installer.CreateRecord(3)
     reclist.StringData(1)  = "OracleError"
     reclist.StringData(2) = "True"
     reclist.StringData(3)  = "This property will only be set if there is an Oracle error"
     propertieslist.Modify msiViewModifyInsertTemporary, reclist  
     propertieslist.close

and the coresponding condition statement on the dialog

Hide &OracleError = "True"

but yeah, it doesn't have the intended effect. When I manually set an entry for OracleError in the Property table I get an error from the script. So it is creating the entry, it just doesn't seem to be reading it.


If anyone knows a way around this, or an other way to deal w/ this please let me know.

Thanks,

Bas


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 04 January 2005 - 09:58

Error 2835: The control [2] was not found on dialog [3]

I don't see what "3490" is doing in the message, maybe the log got confused somewhere.
Anyway, check the spelling of the control names again - esp. the last, "valdation" is not a preferred spelling...

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 January 2005 - 21:24

false, true etc. are not constants that make any sense to Windows Installer. (They are seen as properties with these names).
Use 0 instead of false and 1 instead of true.

Another option would be to use a condition like OracleError=1 and in your custom action (instead of adding rows to the Property table) set the property. In VBScript it would look like this:
Session.Property("OracleError")=1
In other programming languages use the MsiSetProperty API.