inhib Posted August 9, 2005 Share Posted August 9, 2005 Hello !First excuse my bad frenchy english ...I've got a problem with WPI when I try to install programs with the help of .cmd files.... sometime it helps to make some install.cmd...So when windows execute the runonceex commands, I've got a path problem inside all my install.cmd : Windows find the install.cmd files, but it seems that they are executed from c:\, and so i can't find the files that are run INSIDE the install.cmd ...Anybody has an idea ?Thanks ! Link to comment Share on other sites More sharing options...
almulder Posted August 9, 2005 Share Posted August 9, 2005 Could you post one of your .cmd files I will take a look. And where is the folder where you have all your apps at. IS it on the cd or the hard drive. and what is the filder path? Link to comment Share on other sites More sharing options...
inhib Posted August 9, 2005 Author Share Posted August 9, 2005 In the cdrom/wpi/Install folder, I have few program folders... And in some of theses folders, I have setup.exe, and in others I have install.cmd, beacause I need to execute lots of commands to install the program...In an install.cmd I can have some commands like :setup.exe /verisilentcopy xxx c:\xxx\xxxunrar xx.rarAnd the problem is that when you lauch a .cmd file from WPI, it is executed as if it was launched from c:\ and not from its folder !So I have errors lire "cannot find setup.exe, cannot copy xxx, unrar cannot find xxx.rar ..."What is strange is that I'm sure I was doing the same with WPI 3 and I did not have this king of problem Link to comment Share on other sites More sharing options...
almulder Posted August 10, 2005 Share Posted August 10, 2005 One fix is you could add this to the begining of each cmd file.REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD.for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\wpi.ico set CDROM=%%i:echo Found CD-Rom as drive %CDROM%REM Determine the WPI startup path. REM if wpi should run off the cd the replace %~dp0 with %cdrom%.set installpath=%cdrom%/wpi/Install/Rem Program commands to runstart /wait %installpath%\program\setup.exe /verisilentstart /wait %installpath%\program\reg.cmdstart /wait %installpath%\program\cleanup.cmd:endTry this and see if it works. Link to comment Share on other sites More sharing options...
InTheWayBoy Posted August 11, 2005 Share Posted August 11, 2005 (edited) Even easier is to add ".\" before an executable...like so:start /wait .\setup.exe /SWhat that does is it tells the batch file to look in the current directory...so if you have your batch file and the actual program in the same folder, that's the way to go. This is really helpful when you are running an SFX, where it's always extracted to a temp folder...as long as the file is in the same dir as the script, you'll be okay. If you have folders seperating the files, then add the rest from where the script is starting from. So if the exe you want to call is located in a folder called "Files" then you would use this syntax:start /wait .\Files\setup.exeMake sense? Edited August 11, 2005 by InTheWayBoy Link to comment Share on other sites More sharing options...
almulder Posted August 13, 2005 Share Posted August 13, 2005 hay great job, for got about the " .\ " need to go update my code now. thanks 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