Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: EdrickV on May 09, 2002, 10:33:19 pm

Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 09, 2002, 10:33:19 pm
The mention of setting up FRED2 to run a batch file instead of fs2.exe (or fs.exe which it tries now) got me thinking about ways to get FRED2 to run any copy of Freespace 2 without having to have the code and compiling it. :) So I made an extremely simple program called FS.exe that will try to run the batch file RunFS.bat. You can put whatever commands into RunFS.bat that you want. It could run FS2.exe, a modified exe (like FS2b.exe) or if you can make one you could have it run some other program.

(If you don't know how to make a batch file, just make a text file named RunFS.txt with one line: FS2.exe and change it's .txt extention to .bat. Then tell Windows you really do want to change that extention when it complains. :))

You can get my drop-in FS.exe file here:
http://members.aol.com/ArisKalzar/FS.exe
:cool:
Title: "Run Freespace" Drop-In Fix
Post by: WMCoolmon on May 10, 2002, 05:16:59 pm
Try looking in FredView for the line:
Code: [Select]
CreateProcess("..\\..\\Fs.exe", NULL, NULL, NULL, FALSE, 0, NULL, "..\\..", &si, &pi); :nod:
Title: "Run Freespace" Drop-In Fix
Post by: Nico on May 10, 2002, 05:29:12 pm
lol, the easiest way is just to remove the "2" of fs2.exe :)
Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 10, 2002, 05:34:48 pm
I know I could change the line in FRED2, but it wouldn't do any good since I cannot compile it. And it wouldn't help the non-programmers out there who can't compile it or other programmers without VC++ 6.0. At least until FRED2 gets ported to GCC. Also, with my thing you can do command line options and can have a batch script that does things like swap data folders, move VPs, and other stuff. It also won't break the launcher which I'm sure expects a fs2.exe. (I know you could copy it instead of renaming it, but that means more used disk space and again, no command line options.)
Title: "Run Freespace" Drop-In Fix
Post by: Sandwich on May 10, 2002, 05:46:49 pm
Quote
Originally posted by venom2506
lol, the easiest way is just to remove the "2" of fs2.exe :)


I'm glad someone realized that. :rolleyes: :p

Quote
Originally posted by EdrickV
I know you could copy it instead of renaming it, but that means more used disk space ...


Puh-leese... 2.21 megabytes is going to matter to someone nowadays?
Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 10, 2002, 07:33:03 pm
Quote
Originally posted by sandwich

Puh-leese... 2.21 megabytes is going to matter to someone nowadays?


It matters to me but wasn't my main concern. The -window command line option was. I'd have to do it twice and I already have multiple copies of FS2's exe (source built ones plus the original) in one of my folders. And I just wasted 400 MB to see if my computer would work in 1024x768. 2MB may not seem like much to you, but all those little files add up quickly. My 60 Gig HD is getting full.
Title: "Run Freespace" Drop-In Fix
Post by: neimad on May 11, 2002, 10:54:44 am
Why not add a simple configuration dialog that allows you to select the program to launch when you click the "Launch FreeSpace" menu item.

You could also include a way to include optional command line parameters.
Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 11, 2002, 12:49:33 pm
Quote
Originally posted by neimad
Why not add a simple configuration dialog that allows you to select the program to launch when you click the "Launch FreeSpace" menu item.

You could also include a way to include optional command line parameters.


I personally can't do that within FRED2, though I could make a seperate program to do something like that, because I cannot compile FRED2. (The fact that I cannot compile FRED2 is in fact the reason I made this. AFAIK nobody who's changed FS.exe to FS2.exe has posted their FRED2.exe online. DTP changed his FRED2 to run a batch file so he could do command line options.) If someone else did that they'd have to post their exe online so other people could download it and use it otherwise it wouldn't do anyone else any good. The program I made lets you chose what program(s) to run, plus add any other commands, and lets you use whatever command line options you want. And my program works with the regular :v: made FRED2. Once I get my custom launcher for my second FS2 (which uses a different registry key for it's setup options) I'll probably set the batch file to run fs2x.exe or maybe make a fs.exe program to chose which to run when I do it.
Title: Re: "Run Freespace" Drop-In Fix
Post by: TurboNed on May 13, 2002, 03:56:22 pm
Quote
Originally posted by EdrickV
... So I made an extremely simple program called FS.exe that will try to run the batch file RunFS.bat. You can put whatever commands into RunFS.bat that you want. It could run FS2.exe, a modified exe (like FS2b.exe) or if you can make one you could have it run some other program.


Well, I for one understand the usefulness of this program.  Thanks, I'm sure I'll be using it.

FYI, folks - BAT files are NICE (of course, I think Micro$oft's OSes should've stopped at DOS 6.22 - but that's just me.  [grin])

  --TurboNed
Title: Re: Re: "Run Freespace" Drop-In Fix
Post by: Sandwich on May 14, 2002, 07:40:37 am
Quote
Originally posted by TurboNed
FYI, folks - BAT files are NICE (of course, I think Micro$oft's OSes should've stopped at DOS 6.22...


:yes2::nod::yes:
Title: Re: "Run Freespace" Drop-In Fix
Post by: DTP on May 14, 2002, 06:07:27 pm
Quote
Originally posted by EdrickV
(If you don't know how to make a batch file, just make a text file named RunFS.txt with one line: FS2.exe and change it's .txt extention to .bat. Then tell Windows you really do want to change that extention when it complains.


late, but I just thought of it.

If you cannot change the extension it is because you have the default settings for viewing files and maps.

start explorer(mind not the Internet explorer)
Go to View, select map settings / properties

select show/view
and now unmark the radio button that says "hide file name extensions on known filetypes" or something in that way as i have a Danish version.
Title: "Run Freespace" Drop-In Fix
Post by: TurboNed on May 15, 2002, 01:03:31 am
Or do this - it's so much simpler.

Start->Run: "Command.com"

Then type in "cd\Progra~1\Games\Freesp~1" unless you have Freespace 1 installed (and installed it before you installed Freespace 2) in which case you'll want to type in "cd\Progra~1\Games\Freesp~2".  (Make sure you don't actually use the quotes)

Replace the above with the correct path if it's not installed in one of those two places.

Then type "rename fs2.txt fs2.bat" (w/out the quotes, of course).

Then type exit.  There, wasn't that simple?  It doesn't require any mucking about in menus or anything - so much cleaner.

Told you DOS was good.  [grin]

  --TurboNed
Title: "Run Freespace" Drop-In Fix
Post by: Rampage on May 15, 2002, 07:51:11 am
Quote
Originally posted by TurboNed
Told you DOS was good.  [grin]

  --TurboNed


Windows XP Hell!
Title: "Run Freespace" Drop-In Fix
Post by: YodaSean on May 15, 2002, 06:27:30 pm
I'm not sure I understand all of this...
Why can't the problem be resolved by making a copy of fs2.exe and renaming it fs.exe?  I can't seem to find the reason in this thread...
Title: "Run Freespace" Drop-In Fix
Post by: TurboNed on May 15, 2002, 08:04:24 pm
Quote
Originally posted by YodaSean
I'm not sure I understand all of this...
Why can't the problem be resolved by making a copy of fs2.exe and renaming it fs.exe?  I can't seem to find the reason in this thread...


One word: Flexibility.

The problem CAN be solved by simply renaming or copying fs2.exe into fs.exe.  However, if there were a program named fs.exe which called a batch file, one could incorporate all kinds of command-line arguments into the launching of FS2 through FRED2.  When one decided that he or she wanted different command line arguments, they simply edit said batch file.

  --TurboNed
Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 15, 2002, 10:33:45 pm
One of the main reasons I made that little program (and it really is little, 1 line of real code.) was so that I could have FRED2 run my exe (FS2X.exe) without having to name it FS.exe or have to edit and compile the FRED2 source code. (I can edit it just fine, but I can't compile it 'cause it hasn't been ported to GCC yet AFAIK. And I'm not entirely sure if it'll be able to be.)
Another reason was I wanted to have it run with the -window command line option, so I could actually catch any error messages. Once I can get -window working on this computer. (Usually when I'm switching from FRED2 to FS2 I'm testing a mission, ship, weapon, or some other modification.)
Yet another reason is that with my dual FS2 install, my modified exe, and the others I've gotten my FS2.exe files are taking up about 31MB already! (Just noticed that my GCC made ones take up 11.3 MB each. Dang.)
I may make a more full featured program later to act as a launcher/multiple FS2 exe config. (My FS2X exe uses a different registry key so I can change it's settings around without affecting my regular ones, but that means I can't use the regular launcher to configure it. I can use modified registry export files though.)
Title: "Run Freespace" Drop-In Fix
Post by: DTP on May 16, 2002, 12:19:33 am
You really need a new / Bigger hard-drive.
Title: "Run Freespace" Drop-In Fix
Post by: EdrickV on May 16, 2002, 01:33:00 am
This computer's only a bit over a year old I think. And I basically have a 50 gig HD. And I found out that stripping the debug info from my gcc exes reduced their size to about 2.80 megs which is much better. (So for all you GCC compilers, if your exes are 11 megs try running strip on them. :) ) What I should do is move my 15 gigs of Anime digi-subs to CD-Rs. Already moved about 3 gigs off my drive so Windows isn't going to complain for a while. But I can fill up any drive, this one just took a lot longer. :) My last computer had a 1.9 gig and an 8.4 gig (the latter partioned into about 2 gig logical drives) so I really got an upgrade when I got this CPU. On the other hand, I haven't even installed all of my games. :D If I wanted to I could clear up a couple gigs easily I'm sure. If my Zip drive worked I'd dump stuff on zip disks but for now that's not an option. I should clean out my drive and get rid of some old junk though.
Title: "Run Freespace" Drop-In Fix
Post by: ZylonBane on May 16, 2002, 09:05:51 am
Quote
Originally posted by YodaSean
Why can't the problem be resolved by making a copy of fs2.exe and renaming it fs.exe?  I can't seem to find the reason in this thread...
You ever considered applying for a programming position at Microsoft? This attitude is exactly why we NEED 50 gig harddrives for all the bloatware that's coming out these days.
Title: "Run Freespace" Drop-In Fix
Post by: TurboNed on May 17, 2002, 05:14:35 am
Quote
Originally posted by ZylonBane
You ever considered applying for a programming position at Microsoft? This attitude is exactly why we NEED 50 gig harddrives for all the bloatware that's coming out these days.


Zylon - no matter what anyone else says about you...I like you.  (-:

  --TurboNed