Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
casualdevvv authored Jul 15, 2024
1 parent 9ce7eeb commit a926092
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 70 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ const main = async () => {
exit(0);
};

main().catch(err => logger.error(err));
main().catch(err => logger.error(err));
105 changes: 52 additions & 53 deletions modules/constants.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
// sourced these folder mappings from bloxstrap, thanks!

const folderMappings = {
_common: {
'Libraries.zip': '',
'shaders.zip': 'shaders/',
'ssl.zip': 'ssl/',
'WebView2.zip': '',
'WebView2RuntimeInstaller.zip': 'WebView2RuntimeInstaller/',
'content-avatar.zip': 'content/avatar/',
'content-configs.zip': 'content/configs/',
'content-fonts.zip': 'content/fonts/',
'content-models.zip': 'content/models/',
'content-sky.zip': 'content/sky/',
'content-sounds.zip': 'content/sounds/',
'content-textures2.zip': 'content/textures/',
'content-textures3.zip': 'PlatformContent/pc/textures/',
'content-terrain.zip': 'PlatformContent/pc/terrain/',
'content-platform-fonts.zip': 'PlatformContent/pc/fonts/',
'extracontent-places.zip': 'ExtraContent/places/',
'extracontent-luapackages.zip': 'ExtraContent/LuaPackages/',
'extracontent-translations.zip': 'ExtraContent/translations/',
'extracontent-models.zip': 'ExtraContent/models/',
'extracontent-textures.zip': 'ExtraContent/textures/',
},
_playerOnly: {
'RobloxApp.zip': '',
},
_studioOnly: {
'RobloxStudio.zip': '',
'ApplicationConfig.zip': 'ApplicationConfig/',
'content-studio_svg_textures.zip': 'content/studio_svg_textures/',
'content-qt_translations.zip': 'content/qt_translations/',
'content-api-docs.zip': 'content/api_docs/',
'extracontent-scripts.zip': 'ExtraContent/scripts/',
'BuiltInPlugins.zip': 'BuiltInPlugins/',
'BuiltInStandalonePlugins.zip': 'BuiltInStandalonePlugins/',
'LibrariesQt5.zip': '',
'Plugins.zip': 'Plugins/',
'Qml.zip': 'Qml/',
'StudioFonts.zip': 'StudioFonts/',
'redist.zip': '',
},
};

const AppSettings = `<?xml version="1.0" encoding="UTF-8"?>
<Settings>
<ContentFolder>content</ContentFolder>
<BaseUrl>http://www.roblox.com</BaseUrl>
</Settings>`;

module.exports = {
folderMappings,
AppSettings
};

_common: {
'Libraries.zip': '',
'shaders.zip': 'shaders/',
'ssl.zip': 'ssl/',
'WebView2.zip': '',
'WebView2RuntimeInstaller.zip': 'WebView2RuntimeInstaller/',
'content-avatar.zip': 'content/avatar/',
'content-configs.zip': 'content/configs/',
'content-fonts.zip': 'content/fonts/',
'content-models.zip': 'content/models/',
'content-sky.zip': 'content/sky/',
'content-sounds.zip': 'content/sounds/',
'content-textures2.zip': 'content/textures/',
'content-textures3.zip': 'PlatformContent/pc/textures/',
'content-terrain.zip': 'PlatformContent/pc/terrain/',
'content-platform-fonts.zip': 'PlatformContent/pc/fonts/',
'extracontent-places.zip': 'ExtraContent/places/',
'extracontent-luapackages.zip': 'ExtraContent/LuaPackages/',
'extracontent-translations.zip': 'ExtraContent/translations/',
'extracontent-models.zip': 'ExtraContent/models/',
'extracontent-textures.zip': 'ExtraContent/textures/',
},
_playerOnly: {
'RobloxApp.zip': '',
},
_studioOnly: {
'RobloxStudio.zip': '',
'ApplicationConfig.zip': 'ApplicationConfig/',
'content-studio_svg_textures.zip': 'content/studio_svg_textures/',
'content-qt_translations.zip': 'content/qt_translations/',
'content-api-docs.zip': 'content/api_docs/',
'extracontent-scripts.zip': 'ExtraContent/scripts/',
'BuiltInPlugins.zip': 'BuiltInPlugins/',
'BuiltInStandalonePlugins.zip': 'BuiltInStandalonePlugins/',
'LibrariesQt5.zip': '',
'Plugins.zip': 'Plugins/',
'Qml.zip': 'Qml/',
'StudioFonts.zip': 'StudioFonts/',
'redist.zip': '',
},
};

const AppSettings = `<?xml version="1.0" encoding="UTF-8"?>
<Settings>
<ContentFolder>content</ContentFolder>
<BaseUrl>http://www.roblox.com</BaseUrl>
</Settings>`;

module.exports = {
folderMappings,
AppSettings
};
22 changes: 14 additions & 8 deletions modules/extract.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
const fs = require('fs');
const unzipper = require('unzipper');
const path = require('path');
const AdmZip = require('adm-zip');

const extractZip = (filePath, extractTo, mappings) => {
const fileName = path.basename(filePath);

let type = '_common';
if (mappings._playerOnly[fileName]) {
type = '_playerOnly';
} else if (mappings._studioOnly[fileName]) {
type = '_studioOnly';
}

const folderMapping = mappings[type][fileName] || '';

const extractPath = path.join(extractTo, folderMapping);
return fs.createReadStream(filePath)
.pipe(unzipper.Extract({ path: extractPath }))
.promise()
.then(() => extractPath);

return new Promise((resolve, reject) => {
try {
const zip = new AdmZip(filePath);
zip.extractAllTo(extractPath, /*overwrite*/ true);

resolve(extractPath);
} catch (err) {
reject(err);
}
});
};

module.exports = extractZip;
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rbxdl",
"version": "1.0.0",
"description": "Download and extract the supplied hash of the Roblox client",
"name": "rbxlivecli",
"version": "1.0.2",
"description": "A CLI alternative Roblox bootstrapper which downloads the latest version of the Roblox client from the LIVE Channel",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand All @@ -10,13 +10,10 @@
"author": "HW Softworks",
"license": "ISC",
"dependencies": {
"adm-zip": "^0.5.14",
"axios": "^1.7.2",
"cli-progress": "^3.12.0",
"crypto": "^1.0.1",
"fs": "^0.0.1-security",
"protocol-registry": "^1.4.1",
"readline": "^1.3.0",
"unzipper": "^0.12.1",
"winreg": "^1.2.5"
"fs": "^0.0.1-security"
}
}

0 comments on commit a926092

Please sign in to comment.