• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Windows] Tired of copying TFS executable all the time? Look here!

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,323
Solutions
26
Reaction score
2,690
Location
Poland
compile, copy, run, compile, copy, run, compile, copy, run
tired of that? Make the Windows run the app right after compiling without changing anything in the project settings!

Besides one way to start TFS in another directory, there is another one:

1. create a batch file in your main folder* (any name you choose .bat)
*-main folder means the one that has config.lua and data folder
2. paste one line that is your configuration (in this case release, version x64):
Code:
vc14\x64\Release\theforgottenserver-x64.exe
3. save
4. run

if you want to have an icon other than the ugly batch file image:
1. right click on the bat file you created earlier
2. create a shortcut
3. right click the shortcut
4. properties
5. change icon
6. either choose some default or browse files to choose your own
7. rename your shortcut to theforgottenserver-x64 (optional)
8. move or remove tfs executable and dll files that are in your main folder (optional)

example:

1626986065156.png
 
Last edited:
There's also something called Build Events in the Visual Studio project configuration, at Post-Build Event you could add these lines
Code:
copy "$(OutDir)$(ProjectName).exe" "$(Projectdir)..\$(ProjectName).exe" /y
copy "$(OutDir)$(ProjectName).pdb" "$(Projectdir)..\$(ProjectName).pdb" /y

jSA3dmN.png
 
how do i do the same but in linux?
Use proper run script to use tfs in build but execute from main directory.

@topic
You are overthinking here. Just edit where build files are created (Output Directory under General in project properties) or create a shortcut.
Just use .. and it will create .dll and .exe files right in main server directory (next to data, config.lua etc).
1627063710754.png

Or...
Right-click forgottenserver.exe (where it is created by default), copy that shortcut to main directory (next to config.lua), right-click > Properties > Start in set to current path (main directory where data and config.lua are).

So simple.
 
@oen432/@Alpha I have shortcuts to both debug and release in tfs folder. If I did it your way, my dlls would be mixed up. I appreciate your reply though.
 
Back
Top