Jump to content

A problem with paths ...


midiboy

Recommended Posts

HI !

Sorry for this (probably newbie) question but I have been playing around with this for 2 hours now but cannot find the solution ... so I need some help here ...

I am trying to call a cmd from Wihu. That cmd is one directory up from the Wihu directory and then one directory down:

Setup --|
        |-- Wihu
        |-- Dscaler5 (with cmd and Dscaler5005.exe inside)

So inside Wihu (install.ini) I call the cmd like this:

Description.1=DScaler 5
command.1=CMD /C "%WIHU%\..\Dscaler5\silent_install.cmd"
workdir.1=%WIHU%\..\Dscaler5\

The cmd itself looks like this and works if I double click on it inside the DScaler5 directory:

start /wait DScaler5005.exe /VERYSILENT

However, if I let Wihu call this cmd, then DScaler5005.exe cannot be found !

Could you please tell me how I should set the work directory or anything else in install.ini to make this cmd call the exe from Wihu ?

I would like to leave the paths relative so I can call the cmd from the directory and from Wihu no matter if I am installing from CD or from harddisc.

This should be possible, no ?

I am sorry if this has been covered before, I looked through all the helpfiles ...

Thanks,

Alex

Link to comment
Share on other sites


I haven't tried to use cmd files with WIHU, but have you tried specifying the command without "CMD /C"? Another option would be to add the following code to the cmd file to see what the current directory is when that file can't be found.

cd
pause

Link to comment
Share on other sites

I had the exact same problem as you. Whats happening is the CMD is being called, but the active directory isn't where the application is, it's where WIHU is!

I couldn't find an easy answer, so I made the decision that the only installation that mattered was the one being done from the CD.

I set the directory using:

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:\CD.txt set CDROM=%%i:\Install\"NAME OF DIRECTORY HERE"\

and run each program by going

%CDROM%\setup.exe /s

Also, just a stupid question here, but why don't you just use the capabilities of WIHU to install the application? You don't need to call a CMD file for it to install. The reason I do is that it took a long time to make the CMD's do what I want and I don't wanna bother with WIHU and trying to force it to do what I want.

If this isn't the case with you, you could just have WIHU run the programs for you.

EDIT: Most people would probably have the for loop look more like this:

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:\CD.txt set CDROM=%%i:\$OEM$\$1\Install\"NAME OF DIRECTORY HERE"\

Link to comment
Share on other sites

You misunderstand. What I gave him was to put into his CMD file, not to put into WIHU.

Can you set variables like that in WIHU?

I have tried the %SRCPATH% and %SRCDRIVE% commands, and they didn't work properly for me (used the wrong CD drive). I then discovered the

%INIDIR% comand which I beleive to be a much better command (for my purposes anyways).

Link to comment
Share on other sites

Hi guys,

thank you very much for your help everyone !

@ckitching:

thanks, using your idea made me realize that I had set the same workdir for all commands, stupid me ! :P

Everything works now, the way I posted it !

@ tjhart85:

I prefer to use batch files so I can have the same command in Wihu for everything and can also install silently without Wihu (should I ever need that)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...