Page 1 of 1

Create an install Disk

Posted: Sun Dec 08, 2013 9:24 pm
by DR White
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

Re: Create an install Disk

Posted: Sun Dec 08, 2013 9:46 pm
by jmburnod
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

Re: Create an install Disk

Posted: Mon Dec 09, 2013 2:04 pm
by SparkOut
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.