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
- 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
1<body>
2 ...
3 <script>
4 const frame = document.createElement("IFRAME");
5 frame.id = "xsolla-installer-renamer";
6 frame.src = `https://installer.launcher.xsolla.com/launcher-installer-renamer-prod/v1/renamer.html?cache=${Date.now()}`;
7 frame.style = "display: none";
8 document.body.append(frame);
9 </script>
10 ...
11<body>
- 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
1postMessage(
2 {
3 type: "download",
4 href: "<LINK TO INSTALLER>",
5 name: "<NEW INSTALLER NAME>",
6 },
7 "https://installer.launcher.xsolla.com"
8)
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
1<body>
2 ...
3 <a
4 href="#"
5 onclick="document.getElementById('xsolla-installer-renamer').contentWindow.postMessage({ type: 'download', href: '<LINK TO INSTALLER>', name: '<NEW INSTALLER NAME>' }, 'https://installer.launcher.xsolla.com');"
6 >
7 Donwload
8 </a>
9 ...
10<body>
Example code for a download button for the installation file:
Copy
1<body>
2 ...
3 <button id="button-download">Download</button>
4 <script>
5 const btn = document.getElementById("button-download");
6 btn.onclick = () => {
7 document
8 .getElementById("xsolla-installer-renamer")
9 .contentWindow.postMessage(
10 {
11 type: "download",
12 href: "<LINK TO INSTALLER>",
13 name: "<NEW INSTALLER NAME>",
14 },
15 "https://installer.launcher.xsolla.com"
16 );
17 };
18 </script>
19 ...
20<body>
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Found a typo or other text error? Select the text and press Ctrl+Enter.