diff --git a/Applications/App Market.app/Main.lua b/Applications/App Market.app/Main.lua index 302ec1b9..d6ebe968 100644 --- a/Applications/App Market.app/Main.lua +++ b/Applications/App Market.app/Main.lua @@ -514,7 +514,7 @@ local function download(publication) callLastMethod() if not shortcutSwitchAndLabel.hidden and shortcutSwitchAndLabel.switch.state then - system.createShortcut(paths.user.desktop .. filesystem.hideExtension(filesystem.name(filesystemChooser.path)) .. ".lnk", filesystemChooser.path .. "/") + system.createShortcut(paths.user.desktop .. filesystem.hideExtension(filesystem.name(filesystemChooser.path)), filesystemChooser.path .. "/") end computer.pushSignal("system", "updateFileList") diff --git a/Installer/Main.lua b/Installer/Main.lua index 6fbd8635..b9f8f229 100644 --- a/Installer/Main.lua +++ b/Installer/Main.lua @@ -56,7 +56,7 @@ local function filesystemPath(path) end local function filesystemName(path) - return path:match("%/?([^%/]+)%/?$") + return path:match("%/?([^%/]+%/?)$") end local function filesystemHideExtension(path) @@ -504,11 +504,11 @@ addStage(function() workspace:draw() -- Switching to selected filesystem proxy for performing system library operations - filesystem.setProxy(selectedFilesystemProxy) -- Creating system paths - paths.create(paths.system) + filesystem.setProxy(selectedFilesystemProxy) + paths.create(paths.system) local userProperties, userPaths = system.createUser( usernameInput.text, filesystemHideExtension(filesystemName(files.localizations[localizationComboBox.selectedItem])), @@ -517,10 +517,6 @@ addStage(function() screensaversSwitchAndLabel.switch.state ) - -- Renaming HDD - temporaryFilesystemProxy.setLabel("MineOS HDD") - - -- Switching back to temporary fileystem proxy filesystem.setProxy(temporaryFilesystemProxy) -- Flashing EEPROM @@ -580,10 +576,14 @@ addStage(function() -- Create shortcut if possible if shortcut then + filesystem.setProxy(selectedFilesystemProxy) + system.createShortcut( - userPaths.desktop .. filesystemHideExtension(filesystemName(filesystemPath(path)) .. "/") .. ".lnk", + userPaths.desktop .. filesystemHideExtension(filesystemName(filesystemPath(path))), OSPath .. filesystemPath(path) ) + + filesystem.setProxy(temporaryFilesystemProxy) end progressBar.value = math.floor(i / #downloadList * 100) diff --git a/Libraries/Component.lua b/Libraries/Component.lua index 3c8bfa74..fff20fea 100644 --- a/Libraries/Component.lua +++ b/Libraries/Component.lua @@ -13,15 +13,3 @@ end function component.isAvailable(type) return component.list(type)() and true or false end - --- Allows writing component.gpu.set(...) instead of component.get("gpu").set(...) -setmetatable(component, { - __index = function(_, key) - local proxy, reason = component.get(key) - if proxy then - return proxy - else - error(reason) - end - end -}) diff --git a/Libraries/Event.lua b/Libraries/Event.lua index f8a6b27f..4f879710 100755 --- a/Libraries/Event.lua +++ b/Libraries/Event.lua @@ -52,7 +52,7 @@ function event.skip(signalType) end function event.pull(preferredTimeout) - local uptime = computerUptime() + local uptime, signalData = computerUptime() local deadline = uptime + (preferredTimeout or mathHuge) repeat diff --git a/Libraries/Network.lua b/Libraries/Network.lua index c0b837c9..e6ae7a68 100755 --- a/Libraries/Network.lua +++ b/Libraries/Network.lua @@ -540,7 +540,7 @@ local function newModemProxy(address) return request("read", "", ...) end - write = function(handle, data) + proxy.write = function(handle, data) local maxPacketSize = network.modemProxy.maxPacketSize() - network.modemPacketReserve repeat if not request("write", false, handle, data:sub(1, maxPacketSize)) then @@ -681,7 +681,7 @@ function network.update() end end - proxy = newModemProxy(eventData[3]) + local proxy = newModemProxy(eventData[3]) proxy.name = eventData[8] filesystem.mount(proxy, paths.system.mounts .. eventData[3] .. "/") diff --git a/Libraries/System.lua b/Libraries/System.lua index 95b61065..4aa48c10 100755 --- a/Libraries/System.lua +++ b/Libraries/System.lua @@ -106,7 +106,7 @@ end function system.createShortcut(where, forWhat) filesystem.makeDirectory(filesystem.path(where)) - filesystem.write(where, forWhat) + filesystem.write(where .. ".lnk", forWhat) end function system.parseArguments(...) @@ -827,7 +827,7 @@ local function iconOnRightClick(icon, e1, e2, e3, e4) for i = 1, #selectedIcons do if not selectedIcons[i].isShortcut then system.createShortcut( - filesystem.path(selectedIcons[i].path) .. selectedIcons[i].nameWithoutExtension .. ".lnk", + filesystem.path(selectedIcons[i].path) .. selectedIcons[i].nameWithoutExtension, selectedIcons[i].path ) end @@ -840,7 +840,7 @@ local function iconOnRightClick(icon, e1, e2, e3, e4) for i = 1, #selectedIcons do if not selectedIcons[i].isShortcut then system.createShortcut( - paths.user.desktop .. selectedIcons[i].nameWithoutExtension .. ".lnk", + paths.user.desktop .. selectedIcons[i].nameWithoutExtension, selectedIcons[i].path ) end diff --git a/OS.lua b/OS.lua index 98d99294..d0481458 100644 --- a/OS.lua +++ b/OS.lua @@ -33,9 +33,11 @@ end -- Initializing global package system package = { - paths = {["/Libraries/"] = true}, + paths = { + ["/Libraries/"] = true + }, loaded = {}, - loading = {}, + loading = {} } -- Checks existense of specified path. It will be overriden after filesystem library initialization