Added Core Version to the installer as default option

This commit is contained in:
Robert Jelic
2025-11-04 09:53:49 +01:00
parent 5dd2c77dbc
commit 24bd3a0398

View File

@@ -25,22 +25,37 @@ if(args[1] == "-h")or(args[1] == "--help")then
print("Usage: install.lua [options]") print("Usage: install.lua [options]")
print("Options:") print("Options:")
print(" -h, --help Show this help message") print(" -h, --help Show this help message")
print(" -r, --release Install the release version") print(" -r, --release Install the core release version")
print(" -f, --full Install the full release version")
print(" -d, --dev Install the dev version") print(" -d, --dev Install the dev version")
return return
end end
if(args[1] == "-r")or(args[1] == "--release")then if(args[1] == "-r")or(args[1] == "--release")then
print("Installing release version...") print("Installing core release version...")
local request = http.get(fullPath) local request = http.get(corePath)
if not request then if not request then
error("Failed to download Basalt") error("Failed to download Basalt Core")
end end
local file = fs.open(args[2] or "basalt.lua", "w") local file = fs.open(args[2] or "basalt.lua", "w")
file.write(request.readAll()) file.write(request.readAll())
file.close() file.close()
request.close() request.close()
print("Basalt installed successfully!") print("Basalt Core installed successfully!")
return
end
if(args[1] == "-f")or(args[1] == "--full")then
print("Installing full release version...")
local request = http.get(fullPath)
if not request then
error("Failed to download Basalt Full")
end
local file = fs.open(args[2] or "basalt.lua", "w")
file.write(request.readAll())
file.close()
request.close()
print("Basalt Full installed successfully!")
return return
end end
@@ -133,8 +148,8 @@ end
local function createScreen(index) local function createScreen(index)
local screen = main:addScrollFrame(coloring) local screen = main:addScrollFrame(coloring)
:setScrollBarBackgroundColor(colors.black) :setScrollBarBackgroundColor(colors.gray)
--:setScrollBarBackgroundColor2(colors.gray) :setScrollBarBackgroundColor2(colors.black)
:setScrollBarColor(colors.lightGray) :setScrollBarColor(colors.lightGray)
:onScroll(function(self, direction) :onScroll(function(self, direction)
local height = getChildrenHeight(self) local height = getChildrenHeight(self)
@@ -239,17 +254,19 @@ installScreen:addLabel(coloring)
local versionDropdown = installScreen:addDropDown() local versionDropdown = installScreen:addDropDown()
:setPosition("{parent.width - self.width - 1}", 4) :setPosition("{parent.width - self.width - 1}", 4)
:setSize(15, 1) :setSize(20, 1)
:setBackground(colors.black) :setBackground(colors.black)
:setForeground(colors.white) :setForeground(colors.white)
:addItem("Release") :addItem("Release (Core)")
:addItem("Release (Full)")
:addItem("Dev") :addItem("Dev")
:addItem("Custom") :addItem("Custom")
:selectItem(1)
local versionDesc = installScreen:addLabel("versionDesc") local versionDesc = installScreen:addLabel("versionDesc")
:setWidth("{parent.width - 2}") :setWidth("{parent.width - 2}")
:setAutoSize(false) :setAutoSize(false)
:setText("The Release version is the most stable and tested version of Basalt. It is recommended for production use.") :setText("The Core version includes only the essential elements and plugins. It's lighter and faster - perfect for most projects!")
:setPosition(2, 7) :setPosition(2, 7)
:setSize("{parent.width - 4}", 3) :setSize("{parent.width - 4}", 3)
:setBackground(colors.lightGray) :setBackground(colors.lightGray)
@@ -289,8 +306,14 @@ local installPathInput = installScreen:addInput()
:setForeground(colors.white) :setForeground(colors.white)
versionDropdown:onSelect(function(self, index, item) versionDropdown:onSelect(function(self, index, item)
if(item.text == "Release") then if(item.text == "Release (Core)") then
versionDesc:setText("The Release version is the most stable and tested version of Basalt. It is recommended for production use.") versionDesc:setText("The Core version includes only the essential elements and plugins. It's lighter and faster - perfect for most projects!")
additionalComponents:setVisible(false)
luaLSCheckbox:setVisible(false)
luaMinifyCheckbox:setVisible(false)
singleFileProject:setVisible(false)
elseif(item.text == "Release (Full)") then
versionDesc:setText("The Full version contains all elements and plugins. Use this if you need advanced or optional components.")
additionalComponents:setVisible(false) additionalComponents:setVisible(false)
luaLSCheckbox:setVisible(false) luaLSCheckbox:setVisible(false)
luaMinifyCheckbox:setVisible(false) luaMinifyCheckbox:setVisible(false)
@@ -302,7 +325,7 @@ versionDropdown:onSelect(function(self, index, item)
luaMinifyCheckbox:setVisible(true) luaMinifyCheckbox:setVisible(true)
singleFileProject:setVisible(true) singleFileProject:setVisible(true)
else else
versionDesc:setText("The Dev version is the latest development version of Basalt. It may contain new features and improvements, but it may also have bugs and issues.") versionDesc:setText("The Dev version downloads the complete source code as individual files. Perfect for development and debugging!")
additionalComponents:setVisible(false) additionalComponents:setVisible(false)
luaLSCheckbox:setVisible(false) luaLSCheckbox:setVisible(false)
luaMinifyCheckbox:setVisible(false) luaMinifyCheckbox:setVisible(false)
@@ -423,10 +446,11 @@ local function updateProgress(progressBar, current, total)
progressBar:setProgress(math.ceil((current / total) * 100)) progressBar:setProgress(math.ceil((current / total) * 100))
end end
local function installRelease(installPath, log, progressBar) local function installRelease(installPath, log, progressBar, isCore)
logMessage(log, "Installing Release version...") logMessage(log, "Installing Release " .. (isCore and "Core" or "Full") .. " version...")
local request = http.get(fullPath) local releasePath = isCore and corePath or fullPath
local request = http.get(releasePath)
if not request then if not request then
logMessage(log, "Failed to download release version, aborting installation.") logMessage(log, "Failed to download release version, aborting installation.")
return return
@@ -646,7 +670,7 @@ local function installBasalt()
installButton:setVisible(false) installButton:setVisible(false)
local selection = versionDropdown:getSelectedItems()[1] local selection = versionDropdown:getSelectedItems()[1]
if(selection==nil)then if(selection==nil)then
selection = "Release" selection = "Release (Core)"
else else
selection = selection.text selection = selection.text
end end
@@ -656,8 +680,10 @@ local function installBasalt()
else else
path = path:gsub(".lua", "") path = path:gsub(".lua", "")
end end
if(selection == "Release")then if(selection == "Release (Core)")then
installRelease(path..".lua", log, progressBar) installRelease(path..".lua", log, progressBar, true)
elseif(selection == "Release (Full)")then
installRelease(path..".lua", log, progressBar, false)
elseif(selection == "Dev")then elseif(selection == "Dev")then
installDev(path, log, progressBar) installDev(path, log, progressBar)
else else