Skip to content

Commit

Permalink
Fix documentation (OOP API) (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
plata authored Sep 9, 2018
1 parent 66e2323 commit 7bd6069
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 60 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
Even if the application name contains ®, ™ or the like, you should not use it in the folder name.
3. Fill the files:
* [script.js](https://phoenicisorg.github.io/scripts/script-js): actual installation script
* [script.json](https://phoenicisorg.github.io/scripts/script-json): describes the installation script
* [script.js](https://phoenicisorg.github.io/scripts/Develop/script-js/): actual installation script
* [script.json](https://phoenicisorg.github.io/scripts/Develop/script-json/): describes the installation script
```json
{
"scriptName": "Online",
Expand All @@ -43,7 +43,7 @@
}
```
* main.png: application icon (400px x 300px)
* [application.json](https://phoenicisorg.github.io/scripts/application-json): describes the application
* [application.json](https://phoenicisorg.github.io/scripts/Develop/application-json/): describes the application
```json
{
"name": "Steam",
Expand Down
147 changes: 90 additions & 57 deletions docs/_docs/Develop/script-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ A basic script looks like:
```javascript
include(["engines", "wine", "quick_script", "steam_script"]);

new SteamScript()
.name("A Game") // name of the game
.editor("The developer") // editor of the game (see Steam store: developer)
.author("Forename Surname") // author of this script (you)
.appId(123456) // Steam application ID
.go();
var installerImplementation = {
run: function () {
new SteamScript()
.name("A Game") // name of the game
.editor("The developer") // editor of the game (see Steam store: developer)
.author("Forename Surname") // author of this script (you)
.appId(123456) // Steam application ID
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
This script will install the game for the category "Games" and create a shortcut for
Expand All @@ -52,13 +58,19 @@ A basic script looks like:
```javascript
include(["engines", "wine", "quick_script", "uplay_script"]);

new UplayScript()
.name("A Game") // name of the game
.editor("The developer") // editor of the game (see Steam store: developer)
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.appId(123456) // Uplay application ID
.go();
var installerImplementation = {
run: function () {
new UplayScript()
.name("A Game") // name of the game
.editor("The developer") // editor of the game (see Steam store: developer)
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.appId(123456) // Uplay application ID
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
You can determine the app ID by starting the download and checking the folders in `Ubisoft/Ubisoft Game Launcher/data/`.
Expand All @@ -70,14 +82,20 @@ A basic script looks like:
```javascript
include(["engines", "wine", "quick_script", "local_installer_script"]);

new LocalInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
var installerImplementation = {
run: function () {
new LocalInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
### OnlineInstallerScript
Expand All @@ -88,34 +106,46 @@ A basic script looks like:
```javascript
include(["engines", "wine", "quick_script", "online_installer_script"]);

new OnlineInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.url("http://url_to_exe") // where the exe can be downloaded
.checksum("exe_checksum") // sha1sum of the exe
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
var installerImplementation = {
run: function () {
new OnlineInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.url("http://url_to_exe") // where the exe can be downloaded
.checksum("exe_checksum") // sha1sum of the exe
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
### CustomInstallerScript
Executes a custom installation command:
```javascript
include(["engines", "wine", "quick_script", "custom_installer_script"]);

new CustomInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.installationCommand(function(wizard) { // function specifying the installation command
return {command: "msiexec", args: ["/i", "C://app.msi"]};
})
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
var installerImplementation = {
run: function () {
new CustomInstallerScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.installationCommand(function(wizard) { // function specifying the installation command
return {command: "msiexec", args: ["/i", "C://app.msi"]};
})
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
### ZipScript
Expand All @@ -124,16 +154,22 @@ A basic script looks like:
```javascript
include(["engines", "wine", "quick_script", "zip_script"]);

new ZipScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.url("http://url_to_exe") // where the .zip can be downloaded
.checksum("exe_checksum") // sha1sum of the zip
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
var installerImplementation = {
run: function () {
new ZipScript()
.name("Application-Name") // name of the application
.editor("Editor") // editor of the application
.applicationHomepage("http://www.someurl.com") // application homepage
.author("Forename Surname") // author of this script (you)
.url("http://url_to_exe") // where the .zip can be downloaded
.checksum("exe_checksum") // sha1sum of the zip
.category("Category") // category
.executable("Application.exe") // exe name (for the shortcut)
.go();
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);
```
### Advanced
Expand Down Expand Up @@ -217,12 +253,9 @@ setupWizard.presentation(application, "Editor", "http://applicationhomepage.com"

var wine = new Wine()
.wizard(setupWizard)
.architecture("x86")
.version(LATEST_STABLE_VERSION)
.prefix(application)
.prefix(application, "upstream", "x86", LATEST_STABLE_VERSION)
.luna()
.run("your command")
.wait();
.run("your command", ["arg1", "arg2"], null, false, true);

new WineShortcut()
.name(application)
Expand Down

0 comments on commit 7bd6069

Please sign in to comment.