Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local windows = require("windows")
- local fs = require("filesystem")
- local function check(filename)
- if not fs.exists(filename) then
- windows.universalWindow("auto", "auto", 30, 0xFFFFFF, true, {"EmptyLine"}, {"CenterText", 0x000000, "Пути \""..filename.."\" не существует!"}, {"EmptyLine"}, {"Button", {0xFF0000, 0xFFFFFF, "Выйти из программы"}})
- os.exit()
- end
- end
- local function gatherData()
- filePath = gatheredData[1]
- check(filePath)
- imgPath = gatheredData[2]
- check(imgPath)
- name = gatheredData[3]
- end
- local function assemble()
- local appName = "/"..name..".app"
- fs.makeDirectory(appName)
- fs.makeDirectory(appName.."/Resources/")
- fs.copy(imgPath, appName.."/Resources/Icon.png")
- fs.copy(filePath, appName.."/"..name..".lua")
- local lnk = io.open("/System/OS/Desktop/"..name..".lnk", "w")
- lnk:write("return \""..appName.."\"")
- lnk:close()
- end
- gatheredData = windows.universalWindow("auto", "auto", 30, 0xB7B7B7, true, {"EmptyLine"}, {"Input", 0x7B7B7B, 0x7B7B7B, "Путь к исходнику"}, {"Input", 0x7B7B7B, 0x7B7B7B, "Путь к картинке .png"}, {"Input", 0x7B7B7B, 0x7B7B7B, "Название программы"}, {"EmptyLine"}, {"Button", {0x00FF00, 0xFFFFFF, "Собрать!"}, {0xFF0000, 0xFFFFFF, "Отменить"}})
- gatherData()
- assemble()
- windows.universalWindow("auto", "auto", 30, 0xFFFFFF, true, {"EmptyLine"}, {"CenterText", 0x000000, "Сборка успешно завершена!"}, {"EmptyLine"}, {"Button", {0x00FF00, 0xFFFFFF, "Завершить!"}})
Advertisement
Add Comment
Please, Sign In to add comment