installscript
How do you compare versions in InstallScript?
It looks like there is a builtin function, VerCompare, but it requires strings that have all four components, e.g. 1.2.3.4. I haven't tried to do string manipulation in InstallScript and was hoping someone already had the code to take a version string and add .0's as necessary.
Needs some error checking, but here's the general idea: prototype NUMBER CompareVersions(STRING, STRING); prototype STRING FormatVersion(STRING); function NUMBER CompareVersions(leftVersion, rightVersion) STRING formattedLeftVersion, formattedRightVersion; begin formattedLeftVersion = FormatVersion(leftVersion); formattedRightVersion = FormatVersion(rightVersion); return VerCompare(formattedLeftVersion, formattedRightVersion, VERSION); end; function STRING FormatVersion(version) STRING formattedVersion; LIST tokens; NUMBER count; begin tokens = ListCreate(STRINGLIST); StrGetTokens(tokens, version, "."); count = ListCount(tokens); ListSetIndex(tokens, LISTLAST); while (count < 4) ListAddString(tokens, "0", AFTER); count = count + 1; endwhile; StrPutTokens(tokens, formattedVersion, ".", FALSE); ListDestroy(tokens); return formattedVersion; end;
Related Links
Let Setup.exe return '0'(success) when reinstalling - installshield
Limitations of InstallScript “Is(FILE_EXISTS, filename)”?
InstallScript Reboot after multiple prequisites
InstallScript detect app during upgrade?
InstallShield - Detect USB 3.0 Ports
Execute command line statement in installshield / installscript
InstallScript and machine.config
Need an example of /installfromweb command line switch for Installscript Project Setup.exe
How do you compare versions in InstallScript?
unInstallApplication of InstallShield is not working
How to find if the Installatoion was per user or per machine installation
During uninstallation the dll does not remove from system32 folder
Good resources on InstallScript