Domanda

Bottom Line

I have inherited a sizeable InstallShield InstallScript installer, and in working through its InstallScript (*.rul) source files, I notice that variable and parameter data types' casing varies - for what appear to be the same data types. For example, I see variables and parameters of type number and NUMBER, string and STRING etcetera.

Changing between uppercase and lowercase in my experiments has not seemed to make a difference; the installer project compiles either way; but I am not sure whether there may be more to the story.

Does InstallScript data-type casing matter? If it does, when and how does it matter?

Further Context

Coming from .NET, C#, and C++/CLI, I understand that long and Int64 are comparable in C#, whereas long and Int32 are comparable in C++/CLI; but the latter in each pair is different even if only to the extent that it necessitates a using directive for the System namespace. I would like to similarly grok types in InstallScript.

È stato utile?

Soluzione

The answers are sometimes and it depends.

The InstallScript Language Reference's Data Types and Predefined Structures section outlines the rules for data-type casing and indicates "that some data types can be entered in either lowercase or uppercase letters".

According to the Language Reference, over 2/3 (13 of 18) of the InstallScript data types are case-insensitive to the extent that they can be uppercase or lowercase.

Interestingly these types cannot be mixed-case (i.e. a combination of uppercase and lowercase). For example, String (versus STRING or string) yields the following compile-time error:

Description                                     Error Code
----------------------------------------        ----------
'String': expected typedef (struct) name        C8017

Also according to the Language Reference, here are the case-sensitive (just under 1/3 (5 of 18)) data types that can only be uppercase:

  • BOOL
  • HWND
  • LIST
  • LPSTR
  • LPWSTR

Entering these data types in lowercase yields compile-time errors like the following:

Description                                     Error Code
----------------------------------------        ----------
'bool': expected typedef (struct) name          C8017

Beyond this, whether to use uppercase or lowercase where permitted is a matter of preference.

Altri suggerimenti

Let me just add this as a separate answer to list some good information sources.

Check for common Installshield runtime errors and bugs here: http://consumer.installshield.com/common.asp?source=all . As I said, Basic MSI is quite OK, it is just the Installscript MSI that should be avoided.

The Installshield community is good too: http://community.installshield.com/ . As is Stefan Kruger's (MSI MVP) installsite.org with the community at forum.installsite.org.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top