Jump to content




Automatic program editing?


5 replies to this topic

#1 bloodless2010

  • Members
  • 27 posts

Posted 15 July 2012 - 09:23 PM

OK, So bassically, I'm making a program and I have a lot of PC's I want to install it on,
but the thing is, I don't want to type is all out over and over, so I thought why not an "install" disk?
where I'd put a drive next to the console, put the disk in, and it would overwrite the startup with new code for my program, how would I accomplish the editting of startup within a program? Many thanks!

#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 15 July 2012 - 09:30 PM

Take a look at the fs api, specifically fs.copy.
Then just put the program in the disk and make the startup copy it to the computer.

Note: when using fs.copy, if the destination file already exists it will throw an error. You have to check if the file exists, and delete it before copying.

#3 kazagistar

  • Members
  • 365 posts

Posted 16 July 2012 - 02:04 PM

I think the even easier solution is to just use shell.run("copy", "disk/file", "startup")

#4 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 16 July 2012 - 02:44 PM

Yes, but he said overwrite, and copy throws an error if the file exists.

#5 Exerro

  • Members
  • 801 posts

Posted 16 July 2012 - 03:48 PM

for the install try using this code as the startup code on the disk (its quite easy tbh)
Spoiler
the only problem with this is that i have found fs.delete sometimes says action not allowed or something

#6 Dirkus7

  • Members
  • 148 posts
  • Locationthe Netherlands

Posted 16 July 2012 - 11:02 PM

View Postawsumben13, on 16 July 2012 - 03:48 PM, said:

for the install try using this code as the startup code on the disk (its quite easy tbh)
Spoiler
the only problem with this is that i have found fs.delete sometimes says action not allowed or something
shorter:
Spoiler
Does the same, just shortened it up





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users