cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ericpaul
Level 6

InstallScript Custom Action Bug - Tip how to prevent

I have a Basic MSI Project with many InstallScript functions being used in Custom Actions.
I have added functions over the years and used them in Custom Actions without any problems until a few years ago.
Then I created a new function and added an InstallScript Custom Action, but I was unable to select the function's name from the drop down list ... it was empty :confused:.
Being under time constraints I resorted to hacking the XML file :cool:.

Now adding a new InstallScript function and Custom Action with IS2010, I had the same problem again.

After diving into this I finally found the cause:
We know that each function requires a the keyword export preceding the prototype.
Most InstallScript keywords are case sensitive, but certain keywords can be case insensitive such as number, string, pointer and export.
For some reason - I seem to remember an InstallShield version in which the editor converted some keywords to uppercase - that export keyword is capatilized for all my prototypes/functions that need exporting.
This is fine with the editor as it highlights the EXPORT keyword and no compilation errors occur.

Converting the export keywords back to lowercase solved my problem: the drop down list is now being populated as expected.

//Function Name drop down list will not show this function
EXPORT prototype DetermineWebServers(HWND);

// YES!! function will be present in the drop down list
export prototype DetermineWebServers(HWND);

Labels (1)
0 Kudos

(3) Replies
Christopher_Pai
Level 16

Yes, this was covered several years ago...

http://community.installshield.com/showthread.php?t=156176&highlight=function+list

suprise, suprise, it's still broke...
0 Kudos
ericpaul
Level 6

Well Christopher thanks for pointing at this thread.
The remark by MichaelU in that thread is
This one is a bit of a stubbed toe - for the functions to show up in the dropdowns they need to be tagged export. Tagging them EXPORT does not work the same (for the dropdown) and I've heard it has a slightly different internal meaning. Anyway, just make it lower case and it should work a lot better.
Curious that there is a slightly different meaning between export and EXPORT and that it has not been solved yet.
At least my functions show again in the drop down list, so I am 🙂
Cheers, Eric-Paul
0 Kudos
Christopher_Pai
Level 16

Cool. I've been using IS for so many years I pretty much know all the landmines ( bugs ) to step around. Besides, I rarely write InstallScript anymore. I do all of my custom actions in C# using DTF to output Msi Type 1 compatible code.
0 Kudos