Launcher.bat for lazy compilers like me
#1
So I was sick and bored. I noticed compiling adds revision tag novadays to filename. Very cool but I usually like to launch latest revision from shortcut. So I decided to make small launcher that automatically selects latest pcsx2-rxxx.exe. It falls back to pcsx2.exe if no -rxxx tagged files is found and it doesn't launch anything if there is no pcsx2*.exe files.

it should skip develop/debug versions at the moment as delimiter is set to "2-r". So it will skip files like pcsx2vm-r, pcsx2d-rxxx and so on.

I'm pretty sure it won't work with win7 atm as it needs ~dp0 or something to paths. I might fix it later when I boot my win7.

Anyways. feel free to use it if you wan't. I know there are lazy people like me who can't be bothered to rename their files or re-direct their shortcuts all the time.

create new text file and copy following inside it. Rename it to launcher.bat (or filenameYouWant.bat). Run.

launcher.bat v1.0
Code:
@echo off
SetLocal EnableDelayedExpansion
SET LargestValue=0
SET file=pcsx2.exe
for /f "tokens=*" %%G in ('dir /b pcsx2*.exe') do (
set filename=%%G
call :PARSE
)
IF EXIST !file! start !file!
GoTo :EOF

:PARSE
for /f "tokens=2 delims=2-r;." %%L in ("!filename!") do (
IF /I !LargestValue! LSS %%L (
SET LargestValue=%%L
SET file=!filename!
)
)

:EOF
Endlocal


Last but not least. I can't find any reason why this small batch could harm someones pc. Only app it runs is pcsx2.exe it finds.

STILL. Use at your own risk. I'm not taking responsibility if something explodes.
Reply

Sponsored links

#2
i think ... it's also can't work with vista.
the UAC will stop this bat .....
Intel Core i7 980X oc 4.2Ghz (200*21)
MSI N470GTX TwinFrozr II GoldenEdition oc Core 900 Mem 4200 Shader 1800
GSkill DDR3-2000 6-9-6-24 2G*6
Windows 7 Ultimate 64bit
Reply
#3
The current build script I'm using generates the original pcsx2.exe filename into $(ProjectDir)/bin, which expands to something like:

c:\repository\pcsx2\pcsx2\windows\vcprojects\bin\

It might not be useful for the scrpit here per-se, but I bring it up because I've had a few people request the old filenames. Obviously the file is there, just not where people want it. But the question is: where to put them. I thought that putting both the original filename and new rev-tagged filename in the same output directory might be confusing... but in retrospect maybe it wouldn't be?
Jake Stine (Air) - Programmer - PCSX2 Dev Team
Reply
#4
putting them both in the same directory would probably be confusing, i think the current way is fine.

honestly i didn't know we were generating the original pcsx2.exe in another folder in addition to the renamed version.
I also like to create shortcuts to 'pcsx2.exe' like the author of this thread, so i'm glad we still have this option ;p

p.s. i guess i'll make a note of this in the compile thread for future reference.
Reply
#5
(02-07-2009, 10:52 PM)cottonvibes Wrote: honestly i didn't know we were generating the original pcsx2.exe in another folder in addition to the renamed version.

Yeah it's necessary for me to do that in order to maintain a working F5 from the debugger. The original file has to be in the correct location or else the debugger wouldn't be able to find it.

(02-07-2009, 10:52 PM)cottonvibes Wrote: putting them both in the same directory would probably be confusing, i think the current way is fine.

I already put a new update on svn that copies both files, so I guess we'll see how it goes. After thinking it over, I figured it not such a bad idea after all. Many other revision-tagged build systems (most often ones found in linux, since few Win32 project have revision'd builds yet) usually generate automatic untagged symlinks to the most recent build.. ala:

spu2ghz.dll -> spu2ghz-r444.dll

So it's more of an expected convention to do it that way, in a sense.
Jake Stine (Air) - Programmer - PCSX2 Dev Team
Reply
#6
(02-07-2009, 11:04 PM)Air Wrote: I already put a new update on svn that copies both files, so I guess we'll see how it goes. After thinking it over, I figured it not such a bad idea after all. Many other revision-tagged build systems (most often ones found in linux, since few Win32 project have revision'd builds yet) usually generate automatic untagged symlinks to the most recent build.. ala:

spu2ghz.dll -> spu2ghz-r444.dll

So it's more of an expected convention to do it that way, in a sense.

oh okay, we'll see how it goes then ;p
Reply
#7
i did a batch that replaces *.ini, based on user choices.
Example: set pcsx2 res to native, or to 1280x1024, and then launch.

but i think someday they add something to save alternate cfgs
Reply




Users browsing this thread: 1 Guest(s)