1

So I have this pseudo code I need Installscript syntax for, for a Basic MSI installation I am creating with Installshield.

I need to call in a property previously set, [SERIAL] which is three digits long.

If the value is higher than 235 I need to subtract 235 from the value and save it as a string, and another string seperate as 2, otherwise 1. The two result strings then need to be set as new global properties for use later in the installation.

Pseudo code:

// call in the SERIAL property here.

if SERIAL > 235 then

string sIOVERSION = 2;
string sIOIP = "192.22." + (SERIAL - 235) + ".1";

else

string sIOVERSION = 1;
string sIOIP = "192.2." + SERIAL + ".1";

endif

// update properties [IOVER] and [IOIP] to the values of sIOVERSION and sIOIP
DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
Evan May
  • 13
  • 2
  • "Basic MSI" project doesn't use InstallScript, instead you need to use Custom Actions. If you would like to use InstallScript, you would need to use "InstallScript MSI project" or "InstallScript project". What is your question, anyways? – Slava Ivanov Aug 22 '17 at 17:29
  • I've enabled InstallScript on a Basic MSI, the option is above Custom Actions and Sequences. I need the pseudo code in the proper installscript syntax. – Evan May Aug 23 '17 at 07:18

1 Answers1

2

There are other approaches, but as a starting point for doing this in an InstallScript custom action, look for MsiGetProperty and MsiSetProperty, StrToNum, and Sprintf.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44