FOR /F "tokens=1-4 delims=." %%A IN ("%firefox%") DO SET "javaCompareVer=%%A%%B%%C"
this function remove dots.
What my point is after installing first time they need to exit second time by logic but it not...
it install every time...
Ver check & install
Moderator: DosItHelp
Re: Ver check & install
You can create mathematical compareble version variables, e.g.
output:
Code: Select all
@echo off &setlocal
set "firefox=19.0.1"
for /f "tokens=1-3delims=." %%i in ("%firefox%") do set "ht=000%%i"&set "tt=000%%j"&set "hh=000%%k"
set "ht=%ht:~-3%"&set "tt=%tt:~-3%"& set "hh=%hh:~-3%"
for /f "tokens=1*delims=0" %%i in ("$0%ht%%tt%%hh%") do set /a "javaCompareVer=%%j"
echo firefox: : %firefox%
echo javaCompareVer: %javaCompareVer%
endlocal
output:
Code: Select all
firefox: : 19.0.1
javaCompareVer: 19000001