3 Development
zervo edited this page 2024-11-15 15:06:03 +01:00

Development

When working on the patcher, it is recommended you use an IDE.

This is a Mono project, and was created using the MonoDevelop IDE. It should however be compatible with Visual Studio and VSCode (with the right extensions) as well.

Here are instructions for setting up your development environment.

Setting up the environment

1. Clone this repository to your local computer. At the time of writing, I have not yet configured external SSH access for this git instance, so you have to clone over HTTPS. The cloned directory will be referred to as DevDir from now on.

2. Create a "target reference" directory to work against, this can be located anywhere and is just a regular folder. This will be referred to as ReferenceDir from now on. After creating it, copy all the content of C:\Program Files\SafeExamBrowser\Application to ReferenceDir.

3. Download MonoMod. The project uses the net452 release, I'm not sure if a different version will work. Extract the contents of the ZIP file and put it into your ReferenceDir.

4. Open the Directory.Build.props file located in your DevDir and change the path to your ReferenceDir. Can be relative or absolute.

5. Open your DevDir in your IDE and you're done! You have now set up your development environment.

Patches

The patching process is explained in multiple of the websites linked in Resources.

If you are targeting a namespace with internal/protected classes, you need to publicize it first. This is done using a tool like NStrip. It essentially just creates a copy of the provided input file, with all classes/methods made public so that you can reference them in your solution.

An example of this in SEB is the SafeExamBrowser.Client namespace, however at the time of writing I am yet to actually create a patch for that class. Why? Because as soon as I modify it, the chromium browser (or maybe something else) within SEB seems to malfunction and just displays a white page without loading the exam. Being able to modify classes in this namespace could be very useful though, so any solution to this problem is greatly appreciated.