MSFN Forum: A problem with paths ... - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

A problem with paths ... Rate Topic: -----

#1 User is offline   midiboy 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 586
  • Joined: 04-July 04

Posted 12 January 2005 - 07:50 PM

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


#2 User is offline   ckitching 

  • Group: Members
  • Posts: 5
  • Joined: 12-January 05

Posted 12 January 2005 - 08:18 PM

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


#3 User is offline   BenjaminKalytta 

  • Developer
  • PipPipPipPip
  • Group: Members
  • Posts: 609
  • Joined: 08-June 04

Posted 12 January 2005 - 11:56 PM

If you load your INI file with /ini="path\file.ini" switch you should use command.1=CMD /C "%INIDIR%\..\Dscaler5\silent_install.cmd" instead.
%WIHU% is only the path which contains wihu.exe.

Benjamin Kalytta

#4 User is offline   tjhart85 

  • Member
  • PipPip
  • Group: Members
  • Posts: 193
  • Joined: 14-September 04

Posted 13 January 2005 - 12:58 AM

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"\


#5 User is offline   BenjaminKalytta 

  • Developer
  • PipPipPipPip
  • Group: Members
  • Posts: 609
  • Joined: 08-June 04

Posted 13 January 2005 - 01:14 PM

Such an environment variable already exists.
Please use %SRCPATH% and %SRCDRIVE%.
(wihu.exe /?)

Benjamin Kalytta

#6 User is offline   tjhart85 

  • Member
  • PipPip
  • Group: Members
  • Posts: 193
  • Joined: 14-September 04

Posted 13 January 2005 - 10:54 PM

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).

#7 User is offline   BenjaminKalytta 

  • Developer
  • PipPipPipPip
  • Group: Members
  • Posts: 609
  • Joined: 08-June 04

Posted 14 January 2005 - 10:43 AM

Quote

Can you set variables like that in WIHU?


Yes of course you can. Just take a look at the example install.ini and search for [environment] section and it's description.

Benjamin Kalytta

#8 User is offline   midiboy 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 586
  • Joined: 04-July 04

Posted 14 January 2005 - 02:41 PM

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)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy