Jump to content




Simple Install Program


10 replies to this topic

#1 Selkitty

  • Members
  • 58 posts

Posted 28 January 2012 - 09:20 AM

USE THIS SCRIPT TO PUT THE INSTALLER ON A DISK QUICKLY AND EASILY


Very simple script to install a startup program to a dedicated terminal (can be modified to install other things as well) Can also be used to update that program on terminals that already have it.

Thanks to FuzzyPurp for showing me the functions to use to throw this together XD (because I'm a total noob at lua)
NOTE: this code is nolonger used, the code in Kaleb702's post is used instead. the code has been updated a few times, take a look at the code on cc-get to see the changes





fs.delete("NAME") -- startup can be changed if you dont want a dedicated terminal
fs.copy("disk/PROGRAM","NAME") -- PROGRAM is the name of the program you have added to the disk to be installed and startup is the same as above
sleep(1)
print("Your program has been installed.")
print("Shutting down the terminal.")
sleep(2)
shell.run("shutdown")



this is a link to the program itself, use the link at the top to properly add it to a disk ready for use cc-get Link


EDIT: UPDATED THE POST A BIT FOR NO REASON OTHER THAN IT WAS BUGGING ME

#2 Kaleb702

  • New Members
  • 41 posts

Posted 01 February 2012 - 04:56 AM

Took the time to improve your's a little.



file = "" -- Change the file
directory = "" -- Change the directory

term.clear()
textutils.slowPrint("-------------------------")
textutils.slowPrint("Install Mage: " .. file)
textutils.slowPrint("-------------------------")

-- fs
.delete("startup")
fs.copy("disk/" .. file, directory .. file)
os.sleep
(1)
textutils.slowPrint("Your program has been installed. Please remove the disk from your computer.")
print("Thank you for choosing Install Mage.")
io.read()
os.shutdown()

Why? Because now it's just a little bit easier to change the file and directory it is installed to. Also, it now uses the proper practice for shutting down the computer. Avoid shell.run like the plague.

#3 Selkitty

  • Members
  • 58 posts

Posted 01 February 2012 - 07:31 AM

Very nice edit, I'll probably swap over to that. Having named variables makes the world a lot smoother x3 Mine was just built to get the job done when I needed a program to quickly add other programs to multiple terminals and the shell.run was just leftover from a different program I was working on ^^

#4 Kaleb702

  • New Members
  • 41 posts

Posted 01 February 2012 - 06:31 PM

You're welcome, and you can do whatever you want with that.

Also, I totally ruined the highlighting. :(/>

#5 rockymc

  • Members
  • 103 posts

Posted 04 February 2012 - 07:55 PM

Why don't you use the
read()
to read the install dir and file?

#6 Kaleb702

  • New Members
  • 41 posts

Posted 04 February 2012 - 08:37 PM

 rockymc, on 04 February 2012 - 07:55 PM, said:

Why don't you use the
read()
to read the install dir and file?

Mmm, because the user might not know the file. Installers install a specific file. As for the directory, maybe, but they might pick an invalid directory. (Which wouldn't be too hard to fix; if input <is directory and is existing, do normal install> else <make directory, do normal install>)

#7 rockymc

  • Members
  • 103 posts

Posted 04 February 2012 - 09:50 PM

Well, I made my installer. WizTall installs whatever program the user wants to.

#8 FuzzyPurp

    Part-Time Ninja

  • Members
  • 510 posts
  • LocationHarlem, NY

Posted 05 February 2012 - 07:29 AM

 rockymc, on 04 February 2012 - 09:50 PM, said:

Well, I made my installer. WizTall installs whatever program the user wants to.

Hmm.. i don't seem to see it on the forum.

#9 rockymc

  • Members
  • 103 posts

Posted 05 February 2012 - 05:47 PM

 FuzzyPurp, on 05 February 2012 - 07:29 AM, said:

 rockymc, on 04 February 2012 - 09:50 PM, said:

Well, I made my installer. WizTall installs whatever program the user wants to.

Hmm.. i don't seem to see it on the forum.

Gonna publish it.

#10 Selkitty

  • Members
  • 58 posts

Posted 06 February 2012 - 02:36 AM

 rockymc, on 04 February 2012 - 09:50 PM, said:

Well, I made my installer. WizTall installs whatever program the user wants to.

Thats exactly what this installer does. granted yes you have to edit the named variables but it's function is to install a specified program from a floppy to a terminal.

#11 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 13 August 2014 - 03:56 AM

This is the first unlocked thread, so I went to do nerocing on this. (oh, and now I am the king of nerocing. (XD))





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users