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

Categories

HOME
google-app-engine
fabricjs
localization
delphi-7
nvd3.js
github-for-windows
youtube-data-api-v3
google-apps
mips
visual-studio-emulator
ado.net
echo
android-json
modal-dialog
fabric.io
naivebayes
zerobrane
azure-powershell
xmonad
database-connection
googlebot
visual-glitch
babel
tosca
xunit
windows-server-2003
tiki-wiki
android-sharedpreferences
has-and-belongs-to-many
winexe
browser-sync
vex
calculation
google-cast
aws-codecommit
code-snippets
github3.py
swagger-php
plaintext
phpdbg
dynamic-linq
magento-2.0.7
tinkerpop
boo
pybrain
branch-prediction
grails-plugin
omxplayer
redistributable
reporting-services-2012
actor-platform
seek
synonym
installshield-2010
respondcms
google-query-language
aspen
exim4
ascii-art
rasterize
highland.js
gocql
phonertc
opserver
sony-lifelog-api
nsurlsessiondatatask
node-serialport
fail2ban
android-broadcast
android-cookiemanager
universal-image-loader
strawberry-perl
rmysql
unix-socket
named-parameters
jjaql
multitasking
accesscontrolexception
http-patch
breakout
isqlquery
node-blade
css-reset
android-sdk-2.3
device-width
robotlegs
frameworkelementfactory
extconf.rb
thttpd
urlrewriter
pinch
mysql-error-1205
umra
django-paypal
diagrams
office-2007
folding
zen
cfwindow
murmurhash
purepdf
wordprocessingml
httpcookie
appliance

Resources

Encrypt Message