How to set up launcher installer name

How it works

The launcher installer files are named installer.exe for the standalone version and web_installer.exe for the web version by default. You can set your own name in the code of your website. When a user clicks the download button or link, the browser automatically replaces the name of the installation file.

How to get it

  1. Add an invisible iframe to your website's code, inside of which a link to download the installation file with the modified name will be formed, as shown in the example below.

Example:

Copy
Full screen
Small screen
    <body>
      ...
      <script>
        const frame = document.createElement("IFRAME");
        frame.id = "xsolla-installer-renamer";
        frame.src = `https://installer.launcher.xsolla.com/launcher-installer-renamer-prod/v1/renamer.html?cache=${Date.now()}`;
        frame.style = "display: none";
        document.body.append(frame);
      </script>
      ...
    <body>
    

    1. Implement the postMessage() method that passes parameters to the iframe when a link or button is clicked:
      • <LINK TO INSTALLER> — the URL of the installation file. it in Publisher Account in the Launcher > Settings > Launcher Build section. Example: https://installer.launcher.xsolla.com/xlauncher-builds/xsolla-launcher-update/123456789/bin/web_installer.exe
      • <NEW INSTALLER NAME> — the name of the installation file.

    Example:

    Copy
    Full screen
    Small screen
      postMessage(
        {
          type: "download",
          href: "<LINK TO INSTALLER>",
          name: "<NEW INSTALLER NAME>",
        },
        "https://installer.launcher.xsolla.com"
      )
      

      Below are examples of code for a download link and button to download the installation file.

      Example code for a download link for the installation file:

      Copy
      Full screen
      Small screen
        <body>
          ...
          <a
              href="#"
              onclick="document.getElementById('xsolla-installer-renamer').contentWindow.postMessage({ type: 'download', href: '<LINK TO INSTALLER>', name: '<NEW INSTALLER NAME>' }, 'https://installer.launcher.xsolla.com');"
          >
            Donwload
          </a>
          ...
        <body>
        

        Example code for a download button for the installation file:

        Copy
        Full screen
        Small screen
          <body>
            ...
            <button id="button-download">Download</button>
            <script>
              const btn = document.getElementById("button-download");
              btn.onclick = () => {
                document
                  .getElementById("xsolla-installer-renamer")
                  .contentWindow.postMessage(
                    {
                      type: "download",
                      href: "<LINK TO INSTALLER>",
                      name: "<NEW INSTALLER NAME>",
                    },
                    "https://installer.launcher.xsolla.com"
                  );
              };
            </script>
            ...
          <body>
          
          Was this article helpful?
          Thank you!
          Is there anything we can improve? Message
          We’re sorry to hear that
          Please explain why this article wasn’t helpful to you. Message
          Thank you for your feedback!
          We’ll review your message and use it to help us improve your experience.
          Last updated: January 22, 2024

          Found a typo or other text error? Select the text and press Ctrl+Enter.

          Report a problem
          We always review our content. Your feedback helps us improve it.
          Provide an email so we can follow up
          Thank you for your feedback!