This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SupersonicXX9's profile picture

[LUA] I need to know how to make an Installer floppy.

Started by SupersonicXX9, 20 May 2012 - 11:02 PM
SupersonicXX9 #1
Posted 21 May 2012 - 01:02 AM
So, I wanted to make a floppy disk installer, to install a Lock Program on a computer, but I need to know how to make an installer, and if I can have it install with the password the person who wants to install it types. I'm not exactly sure if this is possible though. :P/>/> I'd really like some help with this, and I need a server to make the disk on… and maybe a program that allows me to quickly make the installer disk, because I might ask for 5 gold each, but enough of that part, I really want to know if this is possible and how to do it.

Oh and, I have my own lock system to install, just need to make the install disk xD
Lyqyd #2
Posted 21 May 2012 - 01:05 AM
Just have the program file for the lock read the password out of a file. The installer disk has a program named "install" which asks what the password should be, writes that to a file on the computer, copies the program file over, and either appends the startup file to include it, or provides instructions for adding it to the startup file. Making the installer disk is easy, just copy over the lock program and the install program.
SupersonicXX9 #3
Posted 21 May 2012 - 01:07 AM
Just have the program file for the lock read the password out of a file. The installer disk has a program named "install" which asks what the password should be, writes that to a file on the computer, copies the program file over, and either appends the startup file to include it, or provides instructions for adding it to the startup file. Making the installer disk is easy, just copy over the lock program and the install program.
I don't have an install program yet, I don't know how to make one. :|
Lyqyd #4
Posted 21 May 2012 - 01:12 AM
Just have the program file for the lock read the password out of a file. The installer disk has a program named "install" which asks what the password should be, writes that to a file on the computer, copies the program file over, and either appends the startup file to include it, or provides instructions for adding it to the startup file. Making the installer disk is easy, just copy over the lock program and the install program.
I don't have an install program yet, I don't know how to make one. :|

Perhaps you missed my second sentence:

The installer disk has a program named "install" which asks what the password should be, writes that to a file on the computer, copies the program file over, and either appends the startup file to include it, or provides instructions for adding it to the startup file.

The lua would look vaguely like:


print("Whatchoo wantcher pass'erd ta be?")
local pass = read("*")
local file = io.open("/etc/password", "w" )
if file then
	file:write( pass .. "n" )
	file:close()
end
fs.copy("disk/lockprogram", "/lockprogram")
local file = io.open("startup", "a" )
if file then
	file:write( "shell.run("lockprogram")".. "n" )
	file:close()
end
MathManiac #5
Posted 21 May 2012 - 04:14 AM
You are supposed to find this out yourself. I am working on a large project right now, but I am not asking how to do it. Go here for more info:

http://www.computerc...king-questions/

I would help you if, say, it was an error, but I believe that if you put enough into your program, you will get what you want, and not only that, you will feel Pride in yourself for finding out everything yourself.