Jump to content

Windows Automatic updater/compiler/zip


Guest caeruleaus

Recommended Posts

Not sure if i should do this here or not but it makes sense to be in installation.

This is an automatic batch file to update, compile, and zip mangos. I don't really care about the zip function that much though i did make it work with 7-zip. The original idea came from http://www.scriptdev2.com/windows-ultimate-mangos-t16.html. So i have to thank elegos for the original idea. However i modified it to use vcbuild instead of msbuild and made it work with git for mangos. You can automate this by adding it to the taskscheduler. I'm not going to go into how to do that but you can google it pretty easy.

Anyway have fun, tell me if it works and whatnot. Make sure to update the fields to reflect your setup.

vcbuild will always be in the Microsoft Visual Studio folder, just make sure it's the right version. I have visual studio 9.0 so just make sure it reflects which one you have.

MAKE SURE TO RUN THE BATCH FILE AS ADMINISTRATOR IF YOU WANT ZIPPING TO WORK!

@ECHO OFF
SET VCBUILDDRIVE=C:
SET VCBUILDPATH= Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\vcpackages
::
SET MANGOSPATH=C:\\mangos
:: VC80|VC90|VC100
SET SOLUTIONV=VC90
:: Release|Debug:win32|x64
SET BUILDARCH="Release|x64"
:: Y|N
SET PAUSEMODE=N

:: OPTIONAL

:: Y|N, you need Subversion installed
SET SVNMODE=N
SET SVNDRIVE=C:
SET SVNPATH=Program Files\\TortoiseSVN\\bin

:: Y|N, you need GIT installed
SET GITMODE=N
SET GITDRIVE=C:
SET GITPATH=git\\bin

:: Y|N
SET ARCHIVEMODE=N
:: WINRAR|WINZIP|7ZIP
SET ARCHIVER=7ZIP
SET ARCHIVERDRIVE=C:
SET ARCHIVERPATH=Program Files\\7-Zip
SET ARCHIVENAME=MaNGOS_SD2_svn
SET ARCHIVEPATH=C:\\MaNGOS_bins

IF %GITMODE%==Y GOTO GIT
GOTO BUILD
:GIT
%GITDRIVE%
CD\\
CD %GITPATH%
IF NOT EXIST %MANGOSPATH% git clone git://github.com/mangos/mangos.git %MANGOSPATH%
git --git-dir=%MANGOSPATH%\\.git pull origin master
IF %SVNMODE%==Y GOTO SVN
GOTO BUILD
:SVN
%SVNDRIVE%
CD\\
CD %SVNPATH%
IF NOT EXIST %MANGOSPATH%\\src\\bindings\\ScriptDev2 TortoiseProc /command:checkout /path:%MANGOSPATH%\\src\\bindings\\ScriptDev2 /closeonend:1 /url:[url]https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2[/url]
TortoiseProc /command:update /path:%MANGOSPATH%\\src\\bindings\\ScriptDev2 /closeonend:1 /url:[url]https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2[/url]
IF %PAUSEMODE%==Y PAUSE
:BUILD
%VCBUILDDRIVE%
CD\\
CD %VCBUILDPATH%
vcbuild %MANGOSPATH%\\win\\mangosd%SOLUTIONV%.sln %BUILDARCH% /rebuild
IF %PAUSEMODE%== Y PAUSE
vcbuild %MANGOSPATH%\\src\\bindings\\ScriptDev2\\script%SOLUTIONV%.sln %BUILDARCH% /rebuild

copy %MANGOSPATH%\\src\\mangosd\\mangosd.conf.dist.in %MANGOSPATH%\\bin\\win32_release\\mangosd.conf
copy %MANGOSPATH%\\src\\realmd\\realmd.conf.dist.in %MANGOSPATH%\\bin\\win32_release\\realmd.conf
copy %MANGOSPATH%\\src\\bindings\\ScriptDev2\\ScriptDev2.conf.dist.in %MANGOSPATH%\\bin\\win32_release\\ScriptDev2.conf

IF %PAUSEMODE%== Y PAUSE
IF %ARCHIVEMODE%==Y GOTO ARCHIVER
GOTO END
:ARCHIVER
CD\\
%ARCHIVERDRIVE%
CD\\
CD %ARCHIVERPATH%
IF %ARCHIVER%==WINRAR GOTO WINRAR
IF %ARCHIVER%==WINZIP GOTO WINZIP
IF %ARCHIVER%==7ZIP GOTO 7ZIP
GOTO END
:WINRAR
rar a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\bin\\win32_release\\ -ao -ad -r -ep1
rar a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\sql\\ -apmangos_sql -ao -ad -r -ep1 -x*.svn-base -x*ll-wcprops -x*ntries -x*ormat -xMakefile*
rar a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\src\\bindings\\ScriptDev2\\sql\\ -apscriptdev2_sql -ao -ad -r -ep1 -x*.svn-base -x*ll-wcprops -x*ntries -x*ormat
GOTO END
:WINZIP
GOTO END
:7ZIP
7z d %ARCHIVEPATH%\\%ARCHIVENAME%
7z a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\bin\\win32_release\\ -r -x!*.map -x!*.exp -x!*.lib
7z a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\sql\\ -r -x!*.am -x!*.in -x!*.svn
7z a %ARCHIVEPATH%\\%ARCHIVENAME% %MANGOSPATH%\\src\\bindings\\ScriptDev2\\sql\\ -r -x!*.am -x!*.in -x!*.svn
GOTO END
:END
EXIT

EDIT: Made it work a lot better without the taskkill stuff! WOO

Link to comment
Share on other sites

UPDATE: Made it so you can choose which build type you'd like to make it.

For example, I have Windows 7 64 bit so I have the buildarch set as

"Release|x64"

If you want it for win32

"Release|win32"

To build for x64 your microsoft visual studio MUST be set up for it. There's a few tutorials online that explain how to setup the express editions to build for x64. I am NOT going to help you set it up for x64. Google it.

I did it and so can you.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

i went a bit further, building on top of this "script" (didn't know VS had command line options before i found this thread)

but i was wondering if you got any clue on how to make it compile in VS2010 (they changed vsbuild to msbuild but the whole syntax got changed as well, tried using the info on their forums but i failed)

Link to comment
Share on other sites

guess no one's interested? Ohhhh welll. At least it's useful for me =P

Dude this thing is risky. Maybe people who don't use custom scripts or patches will find it useful. But great effort though

Can you make an auto SQL update maker lyk ... Input start revision then all the files are executed after the "start" revision

Its a real pain to update manually :S

Link to comment
Share on other sites

well it's really just meant for a clean compile. I had updated it so you could actually choose branches you wanted to merge into it and whatnot. I could find a way to see if git returns an exit status failed to cmd and if it does don't go through with everything else but meh (If it does I could give the option of running a merge tool/notepad/whatever program you predefine). If you close the cmd window everything stops anyway so if theres a merge fail than just close it and go fix it.

There are a few of those out there if I remember correctly... but it wouldn't be that hard to do i suppose. I'll see what I can come up with once I'm home. I'm on vacation right now.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use