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
<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>
- 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
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
<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
<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 for your feedback!
We’ll review your message and use it to help us improve your experience.Rate this page
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.