cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Cygnusx1
Level 8

CA: Installer.CreateRecord not working

I have a CA that I have been using for years with Wise. I recently converted to Installshield 12. Now the CA does not work.
Basically the CA calls Installer.CreateRecord to format the record to grab the file path. This file path is then used to check for the file's existence and eventually the file is deleted.

Set oRec = Installer.CreateRecord(0)
oRec.StringData(0) = "[#FileName.mdb]"
Session.FormatRecord(oRec)
If fso.FileExists(Session.FormatRecord(oRec)) Then fso.DeleteFile(Session.FormatRecord(oRec))

Placing msgbox after Session.FormatRecord shows that it was not formatted.

Also, is Session. allways needed when calling a Seaaion Object? In Wise it is not.
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

As described in the "FormatRecord" and "Formatted" help topics, [#filekey] expressions can come back as null based on where the action is scheduled and the file's component state or action.

Also, what does the MsgBox call look like? Are you displaying oRec.StringData(0), or something else? You could test the MsgBox with FormatRecord and [%env] or some other less-schedule-dependent expression to see if that has anything to do with it.

Putting "Session" before Session objects is optional.
0 Kudos
Cygnusx1
Level 8

I "assumed" that when importing files into this new project that the file table would be populated with the actual file name not a lower cased value. All the files and subsequently all the Key Files in the Component Table are lower case. Once the "[#FileName.mdb]" was updated with the key value al lwent according to plan.

Is this process able to be changed? I could not find a way within the Settings or Options. I would like my File and Component Tables files' to considt of the actual file name.

Thank you
0 Kudos