C# developers: if you are new to Sciter with C#, read our CodeProject article

Developing

1. Make sure you have the requirements for building each package (see below).
2. Download a package and open the project in the IDE.
3. Write HTML/CSS code inside the /res folder.
4. Then simply press the Build button in the IDE and then Run the app! It is simple, no?

Probably you will need some sort of host <-> UI communication. For that you write native code in HostSciter.cpp/.d file using one of the 3 idioms in C++, C# or D.


Structure

File Structure

  • /res: where you should put ALL the HTML/CSS code
  • /scripts: build scripts
  • /vendor: third party libraries (e.g.: Sciter headers)

Class/Module code structure

  • class Window: code that creates the native window and process messages, Setup() function is run before everything
  • class Host: code that loads the HTML page; handle Sciter notifications; methods for accessing script side i.e: call_function()
  • Template: template specific code

Resource loading and packaging between DEBUG/RELEASE mode

There is a difference in the way resources are loaded between RELEASE and DEBUG configuration:

  • DEBUG:
    -resources are loaded from local files;
    -URL of page loaded is "file://ABSOLUTE-PATH-TO-RES-DIR/index.html";
    -this method is used in DEBUG mode which is where you spend most of time developing, so you want to build/run the fastest possible, without needing to wait for resources to be packed.
  • RELEASE:
    -res/ folder is packed with `packfolder.exe` which converts it to a binary array in source-code file (e.g: src/archive.cpp)
    -resources are loaded from the source-code packed archive (e.g: src/archive.cpp);
    -URL of page loaded is "archive://app//index.html";
    -after modifying any resource (HTML, CSS) you need to run the 'scripts/pack.bat' script to regenerate the corresponding source-code representing the packed files;
    -in Visual Studio, the script in configured to run as a RELEASE mode Pre-Build command, which may take some time every time you build.


Package requirements

C++ package

Requirements: Visual Studio 2015

Supports 32bits and 64bits build.
Contains Sciter SDK (only the necessary files for reducing size).


C# package

Requirements:
Visual Studio 2015, .NET 4.5 or greater
MonoDevelop 5.10 or greater, GTK+3
Linux: you need to add sciter-gtk-64.so shared library to your path, the downloaded package contains a script for doing that, so just run: 'sudo bash install-libsciter.sh'

Supports 32bits and 64bits build.
Once you press build, it will download the necessary Nuget packages.
With the project open in VS or MonoDevelop, consider upgrading the Nuget package references to the latest version with 'Update-Package -Reinstall'.
Dependencies (already bundled): SciterSharp (Sciter C# bindings).


D package

Requirements: Visual Studio 2015 and the Visual-D plugin; tested only on DMD 2.068.2

Supports 32bits build only.
Package contains a Visual-D project so it is essential to have the plugin for VS installed.
Dependencies (already bundled): sciter-dport (Sciter D bindings).