Skip to content

Instantly share code, notes, and snippets.

@ananace
Last active July 12, 2023 05:57
Show Gist options
  • Save ananace/de7f30454e99b3952405 to your computer and use it in GitHub Desktop.
Save ananace/de7f30454e99b3952405 to your computer and use it in GitHub Desktop.
OpenMW Windows Development Environment Setup - Appveyor scripts

NB; (An updated version of this guide can be found on the wiki)

OpenMW Windows Dev-Env

What you need?

  • Visual Studio 2013 or 2015 (Community edition is enough)
  • MSYSGit or Git for Windows as it's also called (cinst git.install if you have Chocolatey)
  • Note that WSL does not work for this, as it needs to execute windows executables.
  • 7-zip in your path (cinst 7zip.install works, if you have Chocolatey)
  • CMake in your path (cinst cmake.install for Chocolatey)
  • ~10GB of free space per build platform (32/64-bit), for all the build artefacts.
  • Time. An hour or two most likely for full release and debug builds.

What you do?

  • Clone the OpenMW repo. git://github.com/OpenMW/openmw.git
  • Open a Git Bash shell in the repo.
  • Run the following command: CI/before_script.msvc.sh -k -p Win64 -v 2015. (Substitute Win64 with Win32 if doing a 32-bit build, 2015 can also be substituted with 2013 for VS2013)
  • Wait for the build environment to be set up.
  • ???
  • Develop.
Copy link

ghost commented May 7, 2017

So the above was fixed by enabling long file names in the registry. But the script terminates early on when extracting bullet

Copy link

ghost commented May 7, 2017

Making sure I added 7-zip to my environemnt variables path fixed my extraction issues. http://stackoverflow.com/questions/14122732/unzip-files-7-zip-via-cmd-command

@Allofich
Copy link

Allofich commented May 8, 2017

Yes, I had the same issue with it terminating while extracting Bullet when I started using this script, and I also fixed it by setting up 7-Zip in my Path variable.

By the way, I run the above command with "-c Release" in addition to the options it shows, in order to get the dependencies for a Release build. By default you will get the dependencies for a Debug build.

@RL-S
Copy link

RL-S commented May 25, 2017

Hey, I only have access to Visual Studio 2017 (which my university provides). Will that work, too? Do I have to adjust the script for that? On my first try, without any adjustments, I couldn't find any project file for Visual Studio.

@danielbui78
Copy link

Wow! This script works perfectly! I gave up on my prior attempts to build OpenMW due to problems just getting the dependencies to build. I see that your script downloads and installs custom preconfigured and prebuilt versions of these libraries.. all I can say is: Amazing! Thank you! You are now my Favorite Friend!

@SaintMercury
Copy link

SaintMercury commented Jul 7, 2017

As of today, when I tried installing using the script, there seems to be an issue when ffmpeg tries to get downloaded and/or extracted.

I'm not exactly sure the issue, only that when the script tries to rename or download the .7z for ffmpeg 3.0.1, they get corrupted, causing the script to fail.

EDIT: I'm dumb, was an error with the branch OpenMW42. There had not been an update to the CI script that is on master.

@perepechko-alex
Copy link

perepechko-alex commented Aug 1, 2017

@RL-S I just ran the script yesterday, and instead of passing the parameter -v 2015 you can pass -v 2017 and the build environment will set up. So basically just run CI/before_script.msvc.sh -k -p Win64 -v 2017 and it should work.

@jwellnit
Copy link

jwellnit commented Aug 1, 2017

So I'm trying to use the script, but I keep getting an error that line 373 (a cd) has too many arguments. I'm not familiar with bash scripts so I haven't been able to successfully debug. What might cause this error?
screenshot 2

EDIT: so, i fixed the above issue by putting the variable after the cd in "", but now im getting the MoveFile failed error from above, but I've enabled long addresses in the registry. If I ignore that error, then it just stops after bullet even though 7zip is in my PATH.

@crussell187
Copy link

Can we add an option for the install to link all of the setting resource files in the visual studio area rather than hard copy? Most of the time if I change something in those files, I will most likely want the changeset to be on the revision controlled original file and not on the copied file in the target area. Thanks again for supplying this script.

@Langerz82
Copy link

Langerz82 commented Sep 4, 2017

UPDATE: I fixed the below issue by doing this in the script.

#	DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,")
#	cd $(dirname "$DIR")/..
	cd ..

It keeps on crashing on me.

Running prebuild outside of Appveyor. -> then crashes.

Dump File is the only clue it returns:
Exception: STATUS_STACK_OVERFLOW at rip=7FF81E019A27
rax=0000000000001058 rbx=00000000000F6610 rcx=D18BCB9127EF0000
rdx=0000000000000001 rsi=00000000000F846C rdi=0000000000000001
r8 =00000000000E6CB4 r9 =000000000000001B r10=00000000FFFFA000
r11=00000000FFE039C0 r12=0000000000000424 r13=00000000000F8450
r14=0000000000000000 r15=0000000000000000
rbp=00000000000F6610 rsp=00000000FFFFB0A0
program=C:\Program Files\Git\usr\bin\bash.exe, pid 8772, thread unknown (0x1310)
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
000000F6610 7FF81E019A27 (00180010018, 000000E1B14, 000000F846C, 000000E6CB4)
000000F6610 7FF81A2B54EA (000000E1B14, 000000F846C, 000000E6CB4, 000FFFFB4A0)
000000F6610 7FF81A2B72CE (000000F665E, 00000000420, 00000000420, 000000F86BC)
00000000420 7FF81A2B79C6 (000FFFFB3C8, 000000001D8, 00000000000, 0018026E740)
00000000420 7FF81AE7C9E6 (00000000001, 00000000000, 000FFFFB4A0, 00100000001)
00000000420 7FF81C1E3B53 (000FFFFB620, 00000000000, 00000000000, 00000000001)
00000000420 001800A9EA2 (000FFFFB5C0, 00000000000, 00000000000, 00000000000)
000FFFFB640 001800AAA45 (00100410FBB, 00000000001, 0060004F200, 001004E6740)
000FFFFB840 0018011A58B (00100410FBB, 00000000001, 0060004F200, 001004E6740)
000FFFFB840 0000254E458 (00100410FBB, 00000000001, 0060004F200, 001004E6740)
End of stack trace

@mattwla
Copy link

mattwla commented Sep 5, 2017

@SaintMercury

How did you fix this? I'm having the same issue.

@BinToss
Copy link

BinToss commented Oct 23, 2017

@raisthewolf

So, I fixed the above issue by putting the variable after the cd in "" (double quotations)...

(SOLVED)
I had the same problem today while using before_script.msvc.sh from revision f8fec992. I had to put quotes around every $DEPS and $DEPS_INSTALL entry.

Edit: This is because I was building the environment in a subfolder of Program Files. I'm dumb. When in doubt, use quotation marks for anything referring to file/folder paths. Or just do it the right way in the first place.

New issue (SOLVED): While installing QT, Bash states the following:
Qt 5.7.0... (Installation might take a while) Unknown option: silent
Additionally, the installer would cancel if an error is detected. Installed manually following the qs script's instructions while ignoring any unspecified errors like error while installing creation tool after the tool is already installed.

(HELP!)
Next Issue: CMake fails to build project. Before_script.MSVC.sh stops after printing "- Configuring..."
Using CMake commands copied from the SH script to troubleshoot lead me to the error The imported project "J:\Microsoft.Cpp.Default.props" was not found.

@NullCascade
Copy link

@VoidsShadow Are you sure you have cmake in your path? What do you get when you run CI/before_script.msvc.sh with -V (must be capital V). Note that the suggested cinst cmake.install probably won't actually add cmake to path. You'll have better luck with cinst cmake.portable or adding it to the path yourself.

Copy link

ghost commented Nov 11, 2017

Hey so I am trying to install this and it works until "Setting up OpenMW Build -Copying Runtime DLLs-" Then the script exits and says CI/before_script.msvc.sh: line 704: BUILD_CONFIG: unbound variable
Do you guys have any idea of how I could fix this?

@NullCascade
Copy link

@R1ZR: Do you have spaces in your path? If so, that's probably why. Either change your paths, or go through the script and quote things. I'd suggest you use a simple, short path with no spaces (e.g. C:\Projects\openmw).

@Marthgun
Copy link

Marthgun commented Nov 24, 2017

when this creates a project, just looking at the cs project, it loses its organization (folders), and just dumps everything under Source Files , the project name folder, i.e. openmw-cs.

@AnyOldName3
Copy link

An updated version of this guide is available at https://wiki.openmw.org/index.php?title=Development_Environment_Setup#Visual_Studio_2013.2F2015.2F2017_scripted_way

Among other things:

  • It tells you not to do some things that break the script that these instructions don't mention.
  • It explains some things that were vague or absent in this guide, such as how to get configurations other than Debug working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment