Log in

View Full Version : I need a batch file


vdr1981
01-31-18, 04:30 PM
I need a set of batch file commands which would, when executed, create cfg file on the very same location on HDD with following content:

ClientAreaWidth=1184
ClientAreaHeight=765
CameraManager.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
EnvSim.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
kernel.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
sh5.exe=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHCollisions.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHSim.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHSound.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SH_NClient.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SimData.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
LanguagePackInUse=
The trick is that colored parts of the text should be variable and match the actual path of SH5 installation. (taken from registry or anything simmilar)


As you can probably see, I would like to further simplify process of Wolves of Steel installation so my first question would be, is this possible at all?

Thanks in advance! :salute:

XenonSurf
01-31-18, 04:45 PM
I think it's helpful if you take a look in the AODCD game patches (the official ones for the game Aces of the Deep; DOS version); there are batch file commands for any possible directory configuration. I have modified them in the past for making the game playable with DosBox where it was necessary for the patch to run correctly.

I will go in my VMWare and pubhish here these batch commands, but I cannot guarantee that it will be any help for you... The command contains a %, that's for sure.

vdr1981
01-31-18, 04:47 PM
I think it's helpful if you take a look in the AOD game patches (the official ones); there are batch file commands for any possible directory configuration. I have modified them in the past for making the game playable with DosBox where it was necessary that the patch did run correctly.

I will go in my VMWare and pubhish here these batch commands, but I cannot guarantee that it will be any help for you...

That would be quite helpful for the start...:yep: Thanks.

XenonSurf
01-31-18, 04:52 PM
What you can do in the meantime if you have DosBox (or try it in Windows console or by starting Start > Execute 'cmd' is:
Start the DOS session and type '-?' or 'help'
This should fire-up the help for DOS commands, you can use these in batch files.


[EDITED]

XenonSurf
01-31-18, 05:05 PM
Ok, here it goes, first the patch install batch file must decide which language must be installed, then which .bat file to execute.


****************


@echo off
mode co80

:langSel
cls
echo.
echo.
echo AOD Expansion install
echo internet suply peoples
echo
echo
echo If you want to run the program in English, press 'E'.
echo
echo Pour utiliser le programme en fran‡ais, appuyez sur 'F'.
echo
echo Um das Spiel in Deutsch zu spielen, 'D' eingeben.
echo
echo
echo
echo.
echo.


CHUNK\GK.COM

:checkKey
IF ERRORLEVEL 113 IF NOT ERRORLEVEL 114 GOTO end
IF ERRORLEVEL 102 IF NOT ERRORLEVEL 103 GOTO French
IF ERRORLEVEL 101 IF NOT ERRORLEVEL 102 GOTO English
IF ERRORLEVEL 100 IF NOT ERRORLEVEL 101 GOTO German
IF ERRORLEVEL 81 IF NOT ERRORLEVEL 82 GOTO end
IF ERRORLEVEL 70 IF NOT ERRORLEVEL 71 GOTO French
IF ERRORLEVEL 69 IF NOT ERRORLEVEL 70 GOTO English
IF ERRORLEVEL 68 IF NOT ERRORLEVEL 69 GOTO German
goto end

:English
cls
call eng.bat %1
goto end

:German
cls
call ger.bat %1
goto end

:French
cls
call frn.bat %1
goto end

:end


**********************************

ENG.BAT:



@echo off


rem ------ first find out what drive we're installing from ---------
call CHUNK\DRIVE.EXE
IF ERRORLEVEL 25 IF NOT ERRORLEVEL 26 SET IDRIVE=Z
IF ERRORLEVEL 24 IF NOT ERRORLEVEL 25 SET IDRIVE=Y
IF ERRORLEVEL 23 IF NOT ERRORLEVEL 24 SET IDRIVE=X
IF ERRORLEVEL 22 IF NOT ERRORLEVEL 23 SET IDRIVE=W
IF ERRORLEVEL 21 IF NOT ERRORLEVEL 22 SET IDRIVE=V
IF ERRORLEVEL 20 IF NOT ERRORLEVEL 21 SET IDRIVE=U
IF ERRORLEVEL 19 IF NOT ERRORLEVEL 20 SET IDRIVE=T
IF ERRORLEVEL 18 IF NOT ERRORLEVEL 19 SET IDRIVE=S
IF ERRORLEVEL 17 IF NOT ERRORLEVEL 18 SET IDRIVE=R
IF ERRORLEVEL 16 IF NOT ERRORLEVEL 17 SET IDRIVE=Q
IF ERRORLEVEL 15 IF NOT ERRORLEVEL 16 SET IDRIVE=P
IF ERRORLEVEL 14 IF NOT ERRORLEVEL 15 SET IDRIVE=O
IF ERRORLEVEL 13 IF NOT ERRORLEVEL 14 SET IDRIVE=N
IF ERRORLEVEL 12 IF NOT ERRORLEVEL 13 SET IDRIVE=M
IF ERRORLEVEL 11 IF NOT ERRORLEVEL 12 SET IDRIVE=L
IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 SET IDRIVE=K
IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 SET IDRIVE=J
IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 SET IDRIVE=I
IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 SET IDRIVE=H
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 SET IDRIVE=G
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 SET IDRIVE=F
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 SET IDRIVE=E
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 SET IDRIVE=D
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 SET IDRIVE=C
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 SET IDRIVE=B
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 SET IDRIVE=A



:skipit
if '%1' == '' goto chkdef

rem ---- extract the destination drive letter and path from command line

IF NOT '%2'=='' GOTO ChangeD
IF NOT EXIST %1\NUL GOTO BadDir
FOR %%f IN (/%1) DO %0 %%f %1


:========= ChangeD ===========
%1:
CD %2 > NUL

rem --------- make sure they've saved careers properly -----------
goto warning


:startcopy
:next
IF NOT EXIST resource.cfg goto nosim
IF NOT EXIST SIM\NUL goto nosim
IF NOT EXIST SHELL\NUL goto nosim
IF NOT EXIST SOUND\NUL goto nosim

rem ============ Unpack the files =============
cls
echo.
echo ************* Unpacking Files... *************
echo.
copy %IDRIVE%:resource.000 >nul
copy %IDRIVE%:chunk\unchunk.exe >nul
unchunk resource.000 . > nul
if ERRORLEVEL 1 goto BadChunk

rem ===== copy language specific files =========
IF EXIST ENGLISH\NUL goto copystuff
mkdir english > nul
:======= copystuff =========
copy %IDRIVE%:chunk\readme.eng english\readme. >nul
IF EXIST readme.old goto skip1
IF EXIST readme. copy readme. readme.old
IF EXIST read.me copy read.me readme.old

:skip1
IF NOT EXIST readme. goto chngname
@copy english\readme. >nul
goto skip2
:chngname
@copy english\readme. read.me >nul


:skip2
cls
goto playNow



IF EXIST SAVE\NUL goto CDVERSION
IF NOT EXIST SIM\SAVE\NUL goto nosim
goto playNow


:CDVERSION


:playNow
echo.
echo.
echo *********** AOD Mission Disk Installed ! ************
echo * *
echo * *
echo ˙ * To play NOW: *
echo ˙ * Type AOD and press [ENTER]. *
echo * *
echo ˙ * To play LATER: *
echo ˙ * CD to the game directory. *
echo ˙ * Type AOD and press [ENTER]. *
echo * *
echo * If you should ever need to change your sound card *
echo * selection or settings, CD to the game directory *
echo * and run SOUNDSET again. *
echo ************************************************** *******
goto done


:usage
echo To install AOD expansion disk to a specific directory name:
echo.
echo Type "install" followed by the drive letter and path
echo where ACES OF THE DEEP is installed.
echo.
echo For example: "install C:\DYNAMIX\AOD" will attempt to install the
echo mission disk to the DYNAMIX\AOD directory on the C drive.
echo.
echo.
%IDRIVE%:
goto end


:BadDir
:nosim
:noshell
cls
echo.
echo.
echo An installed version of AOD was not found in the specified
echo directory. Please check the drive and directory path and
echo try install again.
echo.
echo.
echo.
echo.
goto usage


:========= chkdef ============
rem
rem check for aod installation in default directories

IF EXIST C:\DYNAMIX\AOD\SIM\SUBSIM.EXE goto def1
IF EXIST C:\DYNAMIX\AODCD\SIM\SUBSIM.EXE goto def2
IF EXIST C:\GAMES\AOD\SIM\SUBSIM.EXE goto def3
IF EXIST C:\GAMES\AODCD\SIM\SUBSIM.EXE goto def4
goto usage


:def1
c:
cd c:\dynamix\aod
cls
echo.
echo.
echo.
echo AOD found at C:\DYNAMIX\AOD
goto confirm

:def2
c:
cd c:\dynamix\aodcd
cls
echo.
echo.
echo.
echo AOD found at C:\DYNAMIX\AODCD
goto confirm

:def3
c:
cd c:\games\aod
cls
echo.
echo.
echo.
echo AOD found at C:\GAMES\AOD
goto confirm

:def4
c:
cd c:\games\aodcd
cls
echo.
echo.
echo.
echo AOD found at C:\GAMES\AODCD
goto confirm


:confirm
echo.
echo Do you wish to install the AOD expansion disk to this directory? (Y/N)
echo.
echo.


%IDRIVE%:\CHUNK\GK.COM
IF ERRORLEVEL 121 IF NOT ERRORLEVEL 122 GOTO warning
IF ERRORLEVEL 110 IF NOT ERRORLEVEL 111 GOTO usage
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 GOTO warning
IF ERRORLEVEL 78 IF NOT ERRORLEVEL 79 GOTO usage
goto usage


:=========== warning ==============
echo ****** Saved Games ******
echo.
echo Career games saved under AoD or AoD CD will not load properly into your
echo simulation once you have installed the Expansion Disk, unless you saved
echo the game while in port. To preserve a career saved while at sea you
echo must first bring your skipper into port and save the game before you
echo install the expansion disk.
echo.
echo Continue with install? (Y/N)
echo.
echo.

%IDRIVE%:\CHUNK\GK.COM
IF ERRORLEVEL 121 IF NOT ERRORLEVEL 122 GOTO startcopy
IF ERRORLEVEL 110 IF NOT ERRORLEVEL 111 GOTO earlyexit
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 GOTO startcopy
IF ERRORLEVEL 78 IF NOT ERRORLEVEL 79 GOTO earlyexit


:======= earlyexit ============
%IDRIVE%:
goto end


rem *********** error handling and clean up *********

:BadChunk
echo unable to extract resource file.
goto done

:Delchunk
del unchunk.exe
goto done

:DelRes
del resource.000
goto done

:done
IF EXIST unchunk.exe goto Delchunk
IF EXIST resource.000 goto DelRes
SET IDRIVE=
SET DEFD=
SET DEFP=
:end



***************************

I hope you can get what you want by association. Good luck :up:
Cheers,

vdr1981
01-31-18, 06:01 PM
Thank you very much XenonSurf although this may be indeed to advanced for me...:hmmm:

Can you please edit your post with code tags and spoilers so we can keep this tread as clear as possible for anyone with possible solution?:yep:

XenonSurf
01-31-18, 06:31 PM
Additionally, I know from making batch files that any names with spaces must be kept in brackets, like "C:\ xxxx xxxx", so your initial example won't work probably.

I still have a printed version of the MS-DOS 5.0 manual :D
Believe me or not, it helps me still today... Thats' how MS Windows is put together... There must be an electronic version. Get it, it has all possible commands.

vdr1981
02-01-18, 03:18 AM
Anyone else? OldCoder? :hmm2:

sputterfish
02-01-18, 07:09 AM
Anyone else? OldCoder? :hmm2:

Hello, VDR. I've created a tool in C# that can generate the config file for you by reading a sh5 regkey. All that is needed is to run the exe and it spits out the cfg file. Can be built using Visual Studio 2017 Community.

https://github.com/sputterfish/silenthuntercfgmaker

It will drop the cfg file in the same directory where it is run, you can of course edit this or if its any use i can help as needed. Not savvy in batch here so if this of no use, oh well.

Cheers

vdr1981
02-01-18, 09:20 AM
Hello, VDR. I've created a tool in C# that can generate the config file for you by reading a sh5 regkey. All that is needed is to run the exe and it spits out the cfg file. Can be built using Visual Studio 2017 Community.

https://github.com/sputterfish/silenthuntercfgmaker

It will drop the cfg file in the same directory where it is run, you can of course edit this or if its any use i can help as needed. Not savvy in batch here so if this of no use, oh well.

Cheers
That sounds very much like my original idea, thank you very much! :up:
I'm having troubles to download the exe? Should I be registered on GitHub in order to download the file?

sputterfish
02-01-18, 09:23 AM
That sounds very much like my original idea, thank you very much! :up:
I'm having troubles to download the exe? Should I be registered on GitHub in order to download the file?

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/1/SilentHunterFolderReader.exe

You should be able to download directly using this link. I can make any changes to the output if needed.

vdr1981
02-01-18, 09:30 AM
https://github.com/sputterfish/silenthuntercfgmaker/releases/download/1/SilentHunterFolderReader.exe

You should be able to download directly using this link. I can make any changes to the output if needed.

Very very nice and exactly what I was looking for! :yeah:

But it needs few tweaks:

The file should be named GenericPatcher.cfg

Also output text should have no " marks or spaces around = mark :yep: Can you edit the app please?

ClientAreaWidth = 1184
ClientAreaHeight = 765
CameraManager.act_=_"D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
EnvSim.act = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
kernel.dll = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
sh5.exe = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
SHCollisions.act = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
SHSound.act = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
SH_NClient.dll = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
SimData.dll = "D:\INSTALIRANE IGRE-Win7\Silent Hunter 5"
LanguagePackInUse =

sputterfish
02-01-18, 09:36 AM
Alright changes made. Should reflect the requested.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

Cheers

vdr1981
02-01-18, 09:44 AM
Alright changes made. Should reflect the requested.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

Cheers

OK...Much better but the output misses following line:

ClientAreaWidth=1184
ClientAreaHeight=765
CameraManager.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
EnvSim.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
kernel.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
sh5.exe=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHCollisions.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHSim.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SHSound.act=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SH_NClient.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
SimData.dll=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
LanguagePackInUse=

Also, just to be on a safe side, you can also remove spaces in ClientAreaWidth/Height lines...:yep::up:

sputterfish
02-01-18, 09:49 AM
Fixed. Same link as before.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

vdr1981
02-01-18, 09:51 AM
Thanks ...testing...:yep:

vdr1981
02-01-18, 09:56 AM
Fixed. Same link as before.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

Perfect! :Kaleun_Applaud:

One more question if I may...:oops:

I've noticed that if the output file with faulty entries is already created prior your app have been executed, the cfg file wont be replaced with correct lines. It will remain the same. Is this possible to fix? :hmmm:

sputterfish
02-01-18, 10:05 AM
Perfect! :Kaleun_Applaud:

One more question if I may...:oops:

I've noticed that if the output file with faulty entries is already created prior your app have been executed, the cfg file wont be replaced with correct lines. It will remain the same. Is this possible to fix? :hmmm:

Updated. Again the same link as before.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

vdr1981
02-01-18, 10:09 AM
Updated. Again the same link as before.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/2/SHFR.exe

EXCELLENT! :Kaleun_Applaud::up::up::up:

Can I bother you with one more cfg file? This one would be for options file editor since a lot of people having troubles to configure the editor on their own? :oops:

sputterfish
02-01-18, 10:18 AM
EXCELLENT! :Kaleun_Applaud::up::up::up:

Can I bother you with one more cfg file? This one would be for options file editor since a lot of people having troubles to configure the editor on they own? :oops:

No problem at all. Just list an example of the file exactly as you would like it, and the name of the cfg file to output.

What are you currently using for the installer software? InnoSetup or just directly creating an installer from scratch in C# is not very hard or time consuming. I'd be willing to assist if interested. It would probably be possible to integrate a check for steam users as well and incorporate the work-around automatically. I use WoS, so happy to contribute something back. :D

Cheers

vdr1981
02-01-18, 10:31 AM
What are you currently using for the installer software? InnoSetup or just directly creating an installer from scratch in C# is not very hard or time consuming.
Actually it's just winrar sef extracting archive with few preset commands. The idea is that once the files are extracted, SFX installer will execute your exe files and configure in game cfg files.

I'd be willing to assist if interested. It would probably be possible to integrate a check for steam users as well and incorporate the work-around automatically. I use WoS, so happy to contribute something back. :D
Cheers
Sounds interesting but that would assume SH5 executable contained withing TWoS installer which can pose a serious problem due to legal issues...:hmmm:

Anyway, "full-blooded" installer is my wish for a long time ...:hmm2:

No problem at all. Just list an example of the file exactly as you would like it, and the name of the cfg file to output.
Great...Stand by...:up:

EDIT

The file should be named OptionsFileEditorViewer.cfg

SH5InstallPath=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5
LastMenuTXT=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5\data\Menu\menu.txt
LastOptionsFilePath=D:\INSTALIRANE IGRE-Win7\Silent Hunter 5\data\Scripts\Menu\
ClientAreaWidth=1014
ClientAreaHeight=736
LanguagePackInUse=

Colored parts should be variable...

sputterfish
02-01-18, 10:37 AM
Sounds good I'll have it posted in just a moment.

As for the SH5.exe file that can be downloaded and extracted automatically from the UBI hosted file, no need to contain the exe within the installer. It would simply be an automated version of what you do manually. Download the file, extract the required files from within the cab, then overwrite the main SH5 executable, etc.

Edit:

New Build with both cfg files, new link below.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/3/SHFR.exe

vdr1981
02-01-18, 12:10 PM
Sounds good I'll have it posted in just a moment.

As for the SH5.exe file that can be downloaded and extracted automatically from the UBI hosted file, no need to contain the exe within the installer. It would simply be an automated version of what you do manually. Download the file, extract the required files from within the cab, then overwrite the main SH5 executable, etc.
Sounds quite interesting...:hmm2:


Edit:

New Build with both cfg files, new link below.

https://github.com/sputterfish/silenthuntercfgmaker/releases/download/3/SHFR.exe
The output file is OK but I need it on different location. Can we have "standalone" app for OFEV cfg?:hmm2:

sputterfish
02-01-18, 12:20 PM
Sounds quite interesting...:hmm2:


The output file is OK but I need it on different location. Can we have "standalone" app for OFEV cfg?:hmm2:

Sure we can do that, if its just a sub folder tho it would be easier to just run one file.

So lets say you run the file from the MAINDIR path you get:
C:\MAINDIR\GenericPatcher.cfg

if the other file needs to be saved below that it is easy. Example:

C:\MAINDIR\SUBDIR\NOMATTER\OptionsFileEditorViewer .cfg

Otherwise I can just make two separate files.

vdr1981
02-01-18, 12:27 PM
Sure we can do that, if its just a sub folder tho it would be easier to just run one file.

So lets say you run the file from the MAINDIR path you get:
C:\MAINDIR\GenericPatcher.cfg

if the other file needs to be saved below that it is easy. Example:

C:\MAINDIR\SUBDIR\NOMATTER\OptionsFileEditorViewer .cfg

Otherwise I can just make two separate files.

I think it's better to use two separate files because I will probably editing folder structure of the mod in the near future...:yep:

sputterfish
02-01-18, 12:42 PM
Updated file links below.

OFEVcfg
https://github.com/sputterfish/OFEVcfg/releases/download/1/OFEVcfg.exe

GPcfg.exe
https://github.com/sputterfish/silenthuntercfgmaker/releases/download/4/GPcfg.exe

vdr1981
02-01-18, 12:54 PM
Updated file links below.

OFEVcfg
https://github.com/sputterfish/OFEVcfg/releases/download/1/OFEVcfg.exe

GPcfg.exe
https://github.com/sputterfish/silenthuntercfgmaker/releases/download/4/GPcfg.exe

Great! :up:
Thank You very much sputterfish! :up::up::up:

sputterfish
02-01-18, 12:57 PM
Glad I could help :salute:

vdr1981
02-01-18, 01:08 PM
Glad I could help :salute:

You have helped a lot mate. These little apps are something that I wish for a long time indeed and I'll make sure to mention your name in the next TWoS update for sure. :yep:

I'll also think about your proposals for improved installer so I hope You'll still be around. :yep:

If You have any more ideas please let me know...:up:

vdr1981
02-01-18, 04:26 PM
Sure we can do that, if its just a sub folder tho it would be easier to just run one file.

So lets say you run the file from the MAINDIR path you get:
C:\MAINDIR\GenericPatcher.cfg

if the other file needs to be saved below that it is easy. Example:

C:\MAINDIR\SUBDIR\NOMATTER\OptionsFileEditorViewer .cfg

Otherwise I can just make two separate files.

I think I have a small problem sputterfish. :hmmm:

When my SFX finishes extraction and execute your exe files, the output files are created directly in the main SH5 root directory and not where they should be, even though my installer did place them in correct subfolders. :hmmm:

Of course, when executed manually by mouse click, everything is OK, so I'm not really sure what is going on...Tried both with and without administration rights on my SFX TWoS installer.

Do you have any suggestions ? Maybe we could try your suggestion from above?:hmmm:

EDIT:
Found this on the net, maybe it's related to the mentioned problem in some way...

If Install.bat is added to archive in a subfolder, it is necessary to specify the batch file with subfolder\Install.bat in Setup dialog of SFX options respectively the comment file. *Done that

And inside the batch file the command line cd "%~dp0" must be added at top to change current directory from target directory of extraction set by SFX module to the extracted subfolder containing the batch file.

sputterfish
02-02-18, 12:57 AM
I think I have a small problem sputterfish. :hmmm:

When my SFX finishes extraction and execute your exe files, the output files are created directly in the main SH5 root directory and not where they should be, even though my installer did place them in correct subfolders. :hmmm:

Of course, when executed manually by mouse click, everything is OK, so I'm not really sure what is going on...Tried both with and without administration rights on my SFX TWoS installer.

Do you have any suggestions ? Maybe we could try your suggestion from above?:hmmm:

EDIT:
Found this on the net, maybe it's related to the mentioned problem in some way...

Yeah the issue is that the program running the apps is running them from another folder so they default to the directory where it is run from I believe. I'll check for a work around.

EDIT:

So by using the following batch you can execute from the subdir like so. Just make sure to replace the words "subdir" with the name of the subdirectory ;)

start cmd.exe /c "GPcfg.exe"
start "" /d "%~dp0subdir" "OFEVcfg.exe"

vdr1981
02-02-18, 07:49 AM
Yeah the issue is that the program running the apps is running them from another folder so they default to the directory where it is run from I believe. I'll check for a work around.

EDIT:

So by using the following batch you can execute from the subdir like so. Just make sure to replace the words "subdir" with the name of the subdirectory ;)

start cmd.exe /c "GPcfg.exe"
start "" /d "%~dp0subdir" "OFEVcfg.exe"

Thanks sputterfish, I'll test it...:salute:

vdr1981
02-02-18, 08:43 AM
Perfect ! Two commands and it works like a charm! :up:

start "" /d "%~dp0MODS\The Wolves of Steel 2.0.0\data\Applications\OptionsFileEditorViewer" "OEcfg.exe"
start "" /d "%~dp0TDW_GenericPatcher_v_1_0_168_0" "GPcfg.exe"

sputterfish
02-05-18, 04:20 AM
Perfect ! Two commands and it works like a charm! :up:

start "" /d "%~dp0MODS\The Wolves of Steel 2.0.0\data\Applications\OptionsFileEditorViewer" "OEcfg.exe"
start "" /d "%~dp0TDW_GenericPatcher_v_1_0_168_0" "GPcfg.exe"

Great to hear! I have updated GPcfg and OFEVcfg apps to use an older version of .NET thus making them more backwards compatible. Please update these if planned for distribution. Any modern Windows dist should support these out of the box but if needed they all utilize the .NET 4.0 Framework.

In addition to that I have also created an updater for folks using the Steam version of the game. All that is needed is a default install of the steam version and the app will proceed to update it automatically. All tools available on github.

https://github.com/sputterfish/silenthuntercfgmaker/releases/tag/5

Cheers

vdr1981
02-05-18, 09:56 AM
Great to hear! I have updated GPcfg and OFEVcfg apps to use an older version of .NET thus making them more backwards compatible. Please update these if planned for distribution. Any modern Windows dist should support these out of the box but if needed they all utilize the .NET 4.0 Framework.

In addition to that I have also created an updater for folks using the Steam version of the game. All that is needed is a default install of the steam version and the app will proceed to update it automatically. All tools available on github.

https://github.com/sputterfish/silenthuntercfgmaker/releases/tag/5

Cheers

Very nice and thank You very much once again!:yep:

So, if I understood You well, Steam users dont have to go trough that lengty procedure. Instead it should be enough to run your "SH5updateSteam.exe"?
Can you describe what exactly your exe will do? What will happen if someone with non-steam version runs your app?

sputterfish
02-05-18, 11:07 AM
Very nice and thank You very much once again!:yep:

So, if I understood You well, Steam users dont have to go trough that lengty procedure. Instead it should be enough to run your "SH5updateSteam.exe"?
Can you describe what exactly your exe will do? What will happen if someone with non-steam version runs your app?

The exe will overwrite any sh5.exe file present in the install directory, regardless of version. Therefore should only be run on the vanilla install as needed. The program will attempt to check for existing backup files, if not present it will continue. As for the process it's simply automating the extraction of cab contents to the install folder. The program will create a copy of your original exe file at sh5.exe.steam and a secondary copy of the patched exe at sh5.exe.patch as a backup for those who go on to use GenericPatcher.

I have been looking for a way to automate using Generic Patcher but it seems it doesn't handle command line args. :(

vdr1981
02-06-18, 11:36 AM
I have been looking for a way to automate using Generic Patcher but it seems it doesn't handle command line args. :(

So there is no way to somehow automate "Yes-Yes-Yes-Yes...." process which is now required? That would be really useful, if possible...:hmm2:

EDIT

One more question Sputterfish, You use Steam version of the game, right?

sputterfish
02-06-18, 05:57 PM
So there is no way to somehow automate "Yes-Yes-Yes-Yes...." process which is now required? That would be really useful, if possible...:hmm2:

EDIT

One more question Sputterfish, You use Steam version of the game, right?

Yes I use the steam version. Yeah so far it doesn't appear it can be automated unfortunately.

vdr1981
02-06-18, 06:14 PM
Yeah so far it doesn't appear it can be automated unfortunately.

Nevermind that... It's perfectly fine as it is now, with your cfg generators of course...:yep:

Yes I use the steam version.
I am trying to implement your Steam Conversion utility into the next TWoS installer but I'm somewhat confused how does the Steam version of the game actually work.

Can Steam version be updated to official v1.2.0 before the conversion (SH5.exe replacement)? :hmmm:

If this is not the case than I can't implement your tool into the main TWoS installer because files extraction would be already done.

Any suggestions? :)

EDIT:
This is how I'm imagining next TWoS installer with your file generators and Steam Conversion tool. http://www.mediafire.com/file/2z330hkesr4any9/The+Wolves+of+Steel+v2.2.0_SH5+Expansion+Pack_Full _SC_Test.exe
Note that the installer it self is almost completely empty without any files in "data" folder, but the concept alone is still visible...
If you can, please run it and tell me can something like this work at all for Steam owners?:hmmm: