I’m currently working on a small-terminal based game like the good old MUD’s, written in C#.
Since I’m hosting it on Googlecode, I used an external .sh-Script to do svn up if the project exists and svn checkout if it doesn’t.
My goal is to include SVN directly into my executable to make it completely platform inependent (see mono).
I already googled generic things like “C# SVN” and it always redicted me to “SharpSVN”. Too bad there is no source inside, just some .dll’s.
Now what I wanted to do (and ask if it’s possible anyways):
- Start the application
- Check if a newer revision is avaible
- Do
svn up - Compile
- Launch the new executable if revision numbers aren’t equal to what they were last time (aka. newer rev was built)
I’m highly in doubt if it’s possible to launch the application after quitting, but you surely know more than me;)
EDIT://
Here is the .sh-script which I was running before/am running currently:
#!/bin/bash
if [ $# -eq 0 ]; then
if [ ! -d "$HOME/csdungeon" ]; then
echo "Which version would you like to download? (G)erman / (E)nglish"
read getinput
case "$getinput" in
G|g) svn checkout http://c-sharp-dungeon.googlecode.com/svn/branches/translations/german/ $HOME/csdungeon
;;
E|e) svn checkout http://c-sharp-dungeon.googlecode.com/svn/trunk $HOME/csdungeon
;;
*) echo "No correct localisazion selected."
echo "Downloading english version now:"
svn checkout http://c-sharp-dungeon.googlecode.com/svn/trunk $HOME/csdungeon
;;
esac
else
cd $HOME/csdungeon
svn up
rm $HOME/csdungeon/c-sharp-dungeon.exe
fi
gmcs -out:$HOME/csdungeon/c-sharp-dungeon.exe $HOME/csdungeon/*.cs
mono $HOME/csdungeon/c-sharp-dungeon.exe
fi
if [ $# -ge 1 ]; then
if [ ! -d "$HOME/csdungeon" ]; then
echo "Which version would you like to download? (G)erman / (E)nglish"
read getinput
case "$getinput" in
G|g) svn checkout https://c-sharp-dungeon.googlecode.com/svn/branches/translations/german/ $HOME/csdungeon --username $1
;;
E|e) svn checkout https://c-sharp-dungeon.googlecode.com/svn/trunk $HOME/csdungeon --username $1
;;
*) echo "No correct localisazion selected."
echo "Downloading english version now:"
svn checkout https://c-sharp-dungeon.googlecode.com/svn/trunk $HOME/csdungeon --username $1
;;
esac
else
cd $HOME/csdungeon
svn up
rm $HOME/csdungeon/c-sharp-dungeon.exe
fi
gmcs -out:$HOME/csdungeon/c-sharp-dungeon.exe $HOME/csdungeon/*.cs
mono $HOME/csdungeon/c-sharp-dungeon.exe
fi
Your step-by-step won’t work without a helper app. I’d suggest performing the check, then spawning the helper app, closing this one. The helper app then does the download/compile/relauch. I reckon UAC would have a field-day with it. Make sure you consider this from the outset.