CoreInstaller

Guide on how to use JaxCore's powerful version control tool.

What's CoreInstaller?

CoreInstaller allows your users to install your module even without Rainmeter installed, and allows your module to self-update with a single click. This does not require JaxCore to be installed.

This is meant for advanced skin publishers only. If you're new to releasing skins, consider adding this later down your development schedule.

Complete a 3-step process for basic setup, and another 3-step process to allow your module to self-update.

Basic setup

The following section expects basic knowledge on how to setup a Github repository. If you're having trouble with this, Google's your best friend.

  1. Create a Github Repository with your skin name as the repository name

  2. Clone local skin folder to Github Repository. Have your skin folder as the root folder. (Optional)

  3. The releases section is where you'll upload new versions of your skin. When uploading your .rmskin file, make sure to give the release a version tag. Documentation on how to compile your rmskin release can be found here

Now your skin can be installed via the following command:

Make sure to replace any occurances of MySkin and MyUser with your Github Repo's name and your username in the sections following.

Example: If your Github username is timmy and your repo name is my-first-skin: MyUser/MySkin --> timmy/my-first-skin

The slash must be forward!

$o_NoPostActions=$true;$o_InstallModule='MyUser/MySkin';iwr -useb 'https://raw.githubusercontent.com/Jax-Core/JaxCore/master/CoreInstaller.ps1' | iex

You can also add the installation guide to your README.md file so it's easier for users to install your module

  1. Create a README.md file in the root of your skins folder

## How to install
Run the following command in Powershell to install the latest version.

```
$o_NoPostActions=$true;$o_InstallModule='MyUser/MySkin';iwr -useb 'https://raw.githubusercontent.com/Jax-Core/JaxCore/master/CoreInstaller.ps1' | iex
```

In-app updater

Complete the following setups to allow your skin to self-update. You'll need the following things in your module for it to work.

  • A way to allow users to click on something to update

  • A powershell script located in the resources folder (or anywhere within the skin)

1. Setup the measure in your skin

Replace path_to_powershell_script with corresponding path

[CoreInstallHandler]
Measure=Plugin
Plugin=PowershellRM
DynamicVariables=1
ScriptFile=#path_to_powershell_script#
ExecutionPolicy=Unrestricted

2. Setup the Powershell script

function Install($Version) {
    # ---------------------------------- Command --------------------------------- #
    $command = "-command `"`$o_NoPostActions=`$true;`$o_InstallModule='MyUser/MySkin';"
    $rminstalledat = join-path "$($RmAPI.VariableStr('SETTINGSPATH'))" ""
    # If installation is portable
    If (!((join-path "$Env:APPDATA\Rainmeter\" "") -eq ($rminstalledat))) {
        $rminstalledat = Split-path "$rminstalledat"
        $command += "`$o_Location='$rminstalledat';"
    }
    # If specific version is requested
    If ($Version) {
        $Version = $Version -replace 'v', ''
        $command += "`$o_Version='$Version';"
    }
    $command += "iwr -useb 'https://raw.githubusercontent.com/Jax-Core/JaxCore/master/CoreInstaller.ps1' | iex`""
    # --------------------------------- Fallback --------------------------------- #
    # Put any bangs here that should be ran everytime that you run the local updater, to let the user know what they should do if the installer doesn't work.
    # ---------------------------- Launch PS instance ---------------------------- #
    If (Test-Path "C:\Windows\System32\WindowsPowershell\v1.0\powershell.exe") {
        Start-Process "C:\Windows\System32\WindowsPowershell\v1.0\powershell.exe" -ArgumentList "-ExecutionPolicy Bypass", $command
    } else {
        Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass", $command
    }
}

3. Setup action in your skin

# To get the latest version
LeftMouseUpAction=[!CommandMeasure CoreInstallHandler 'Install']
# To get a specific version
LeftMouseUpAction=[!CommandMeasure CoreInstallHandler 'Install v1.5']

Last updated