lek Posted April 21, 2006 Share Posted April 21, 2006 (edited) Hi all,I'm sure I must be missing something totally obvious here, but I can't seem to find the cause of the problem I'm having. The problem is that when running a command script (.cmd file), variable names that are enclosed in exclamation marks (like !HFSLP! or !VERSION!) don't get parsed (i.e. they do not return the value that the variable contains). Hence, statements like:SET /A HFSLP=!HFSLP! + 1fail completely, and since these are used a lot in the HFSLIP script, the entire slipstream process fails.I have tried the April 1 and April 21 versions of HFSLIP, and both give the same result. An example of the output shown:Expanding WindowsInstaller-KB893803-v2-x86.exeFile not found - *.*0 File(s) copiedA subdirectory or file TEMP\UPDATE already exists.0 File(s) copiedThe system cannot find the path specified.The system cannot find the path specified.The system cannot find the path specified.Integrating WindowsInstaller-KB893803-v2-x86.exeFile not found - TEMP0 File(s) copied199 COMPLETEThe system cannot find the file specified.Processing Windows UpdateFINDSTR: Cannot open WORK\INFS\199.INFCompleted WindowsInstaller-KB893803-v2-x86.exeI also tried an older HFSLIP version (dated Februari 3rd, 2006) and get the same results. This version had previously run without problems on the same system, so something must have been changed to the OS or to my system configuration. For the heck of me, I can't think of anything what that might be. I am running XP Pro SP2, with all hotfixes installed.Any suggestions?Thanks!PS: Just curious: why are exclamation marks used around those script variables anyhow? I always thought that one is supposed to use percentage marks (like %VARIABLE%). When changing the exclamation marks to percents, the offending statements run fine... Edited April 21, 2006 by lek Link to comment Share on other sites More sharing options...
Tomcat76 Posted April 21, 2006 Share Posted April 21, 2006 Exclamation marks and percentage signs are supposed to work just the same. I don't have any problems with the former, but I'm running Win2K. Maybe someone else can shed some more light on this. Link to comment Share on other sites More sharing options...
lek Posted April 22, 2006 Author Share Posted April 22, 2006 (edited) I've located the cause of the problem... and it weren't the exclamation marks after all. Serves me right for trying to do something intelligent on a Friday night. What had happened was that when moving some of the source files around my file system, XP somehow decided to rename the file "WIN51IP.SP2" (uppercase) to "win51ip.sp2" (lowercase). That resulted in an unintended effect in the following line:IF "%VERSION%"=="XP" ( SET T1=TommyP's HFSLIP XP/WMP10/WUA20 Hotfix Slipstreamer TITLE %T1% SET PREP=%~dp0 rem SET SP=SP2 if exist source\*.sp* (for /f "tokens=1,2 delims=." %%i in ('dir /b source\*.sp*') do set SP=%%j) else (set SP=SP0) CALL :SLIPSTREAM )...because the SP variable is set to "sp2", instead of "SP2". Later, in the "BANDAIDXP2K3" routine, the problem occurs:IF "!SP!"=="SP0" SET SPUPDATE=SP1IF "!SP!"=="SP1" SET SPUPDATE=SP2IF "!SP!"=="SP2" SET SPUPDATE=SP3IF "!SP!"=="SP3" SET SPUPDATE=SP4IF "!SP!"=="SP4" SET SPUPDATE=SP5IF "!SP!"=="SP5" SET SPUPDATE=SP6IF "!SP!"=="SP6" SET SPUPDATE=SP7Here, the SPUPDATE variable is supposed to get set to "SP3", but remains undefined because SP gets tested for uppercase values, but contains a lowercase one. This leads to further pain and suffering further along the execution path.Anyhow, thanks for the quick reply; hope this clarifies things. Cheers. Edited April 22, 2006 by lek Link to comment Share on other sites More sharing options...
Super-Magician Posted April 22, 2006 Share Posted April 22, 2006 I see, lek! All Tomcat needs to do is add the /I switch to those IF commands and everything should be fine . Link to comment Share on other sites More sharing options...
Tomcat76 Posted April 22, 2006 Share Posted April 22, 2006 It would've affected other script portions as well so adding a /I to those IF command lines alone wouldn't be enough. I updated the first script section in lek's post (and its surroundings). Try the latest test release. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now