Create an install Disk

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Create an install Disk

Post by DR White » Sun Dec 08, 2013 9:24 pm

I have created an app that some people want to run on their windows 7 system.

I am having a little trouble making an install disk. I really don't know very much about copy files with LC

This is what I have tried, but it does not work:
----- Copy file
put specialfolderpath("Test") & "/Test.exe" into tFile
put FileData into url("file:" & tFile)
----------------------------------------------------

----- Copy Shortcut
put specialfolderpath("desktop") & "/Test.lnk" into tFile
put FileData into url("file:" & tFile)
----------------------------------------------------
Some guidance will be appreciated.

Thanks,

David

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Create an install Disk

Post by jmburnod » Sun Dec 08, 2013 9:46 pm

hi David,

For the first
----- Copy file
put specialfolderpath("Test") & "/Test.exe" into tFile
put FileData into url("file:" & tFile)
You have to get an available specialfolderpath() and check if the folder exists.

Code: Select all

on copyMyStuff pFileData
   put specialfolderpath("documents") & "/" & "test" into tFolder
   if there is not a folder tFolder then
      new folder tFolder
   end if
   put tFolder & "/" & "Test.exe" into tFile
   put pFileData into url("file:" & tFile)
end copyMyStuff
should works

Sorry i don't know what to do for ----- Copy Shortcut

Best regards
Jean-Marc
https://alternatic.ch

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Create an install Disk

Post by SparkOut » Mon Dec 09, 2013 2:04 pm

To make a shortcut icon:
create alias (specialFolderPath("desktop") & "/mylink.lnk") to file "<path to executable>"
-- Make sure you include ".lnk" in the alias name for Windows to work

-- Depending on permissions, you can also
create alias (specialFolderPath(25) & "/mylink.lnk") to file "<path to executable>"
-- which will (try to) create a shortcut alias on the "All Users" desktop. If you have UAC on then you will likely find the result holds an error instead. EDIT: unless you start the livecode application with "Run As Administrator"

See http://www.sonsothunder.com/devres/revo ... ile010.htm for other specialFolderPath locations, for instance the Start>Programs menu.

Post Reply