I have a question about the Corona that may seem a bit simple and very beginner, but is that really never tried to know and today was taking a look and found nothing concrete … Da to develop desktop application with Corona, right? “Desktop application” = Program for windows? If so, how do I develop a program for windows using Corona?
Are you asking, “How do I use Corona to write a desktop app for Windows and/or OS X”?
Just write your app like you would normally and configure it for desktop in build.settings
- https://docs.coronalabs.com/guide/distribution/buildSettings/index.html
- >> https://docs.coronalabs.com/guide/distribution/win32Build/index.html
- >> https://docs.coronalabs.com/guide/distribution/osxBuild/index.html
If you want to distribute your desktop app, you’ll have to sign it.
I’m not sure, but I think there is a page on the site about this too, but I don’t have the link.
@anyone - If anyone has this link, please paste it below.
Hmmmmm was exactly that, but, does not it have the EXE to come alone without all the dlls?
Are you using a Mac or a Windows machine?
You can only build for Win32 with the Windows version of the Corona simulator.
Vice Versa
You can only build for OS X with the OS X version of the simulator.
Just like building for any other target, everything you need to distribute it produced by the build process.
For example, if you are running the simulator on Windows, you can select: File -> Build -> Windows.
This will produce a folder on your harddrive containing the EXE and other files. You must distribute the entire folder:
Corona does not produce a MSI or any other installer. If you want to make an auto-installer you need to do that on your own. There are tools on the web for this.
Yes, I was using a windows machine and I really did not know that it was possible to create an installer with these files by web tools, really roaminggamer thank you very much !! Just one last question … Is there any specific API for windows? (What I mean is: Can I have the possibility of eg renaming a file on my computer using a program made in the corona? Or are the limitations of the corona large?)
Are you asking, “Can I rename, delete, copy files on a Windows system from within a Corona program?”
If that is the question, the answer is, “Yes.”
Disclaimers:
- The end user may be running a virus scanner that could block your app. They need to ‘allow the app to access folders, etc.’ and that is on them.
- The OS will not allow you to write protected folders like the system32 and program files folders.
If the question, what API do I use? Well, I use SSK2’s file library:
- https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/
- DESKTOP SPECIFIC FEATURES: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop
- UTILITIES: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#utilities-sskfilesutil
For example. Let’s assume I have a file called “bob.png” on my desktop and I want to duplicate it and put it in “c:\mydata” which already exists.
If you have SSK2in your app, the above example would be coded like this:
-- Create the paths local src = ssk.files.desktop.getDesktopPath("bob.png") local dst = ssk.files.desktop.getDrivepath("c:/mydata/bob.png" ) -- optionally 'repair' file path dst = ssk.util.repairPath( dst ) -- The Copy ssk.files.util.cpFile( src, dst )
What is that bit about ‘repairing’ the path?
Well… in Windows, the path separator is a backslash: **
Unfortunately, a backslash () is also treated as a escape encoder. It tells Lua that the following character is special and should be re-interpreted.
- “\n” - newline
- “\r” - carriage return
- “\t” - tab
So, if you wanted to CORRECTLY encode the path on Windows you would type:
local dst = ssk.files.desktop.getDrivepath("c:\\mydata\\bob.png" )
However, I find this to be a pain in the butt and really not necessary. So, I always type paths using the forward slash: /
Additionally, my file utilities can handle either. On top of that, in case you want to print the path, I have the repair path utility to adjust the path encoding to match the current OS protocol.
Long story short, USE FORWARD SLASHES AND YOU WILL ALWAYS BE OK.
My God, it looks like my head is exploding discovering a new world of CoronaSDK hahahahahah Thank you very much, again you helped me a lot (: I think of several things that could be done … The question if I could change / rename a place file it was basically for me to know what “limit” I can achieve using CoronaSDK for desktop, but it looks like I get great deeds =) Thanks again !!
Are you asking, “How do I use Corona to write a desktop app for Windows and/or OS X”?
Just write your app like you would normally and configure it for desktop in build.settings
- https://docs.coronalabs.com/guide/distribution/buildSettings/index.html
- >> https://docs.coronalabs.com/guide/distribution/win32Build/index.html
- >> https://docs.coronalabs.com/guide/distribution/osxBuild/index.html
If you want to distribute your desktop app, you’ll have to sign it.
I’m not sure, but I think there is a page on the site about this too, but I don’t have the link.
@anyone - If anyone has this link, please paste it below.
Hmmmmm was exactly that, but, does not it have the EXE to come alone without all the dlls?
Are you using a Mac or a Windows machine?
You can only build for Win32 with the Windows version of the Corona simulator.
Vice Versa
You can only build for OS X with the OS X version of the simulator.
Just like building for any other target, everything you need to distribute it produced by the build process.
For example, if you are running the simulator on Windows, you can select: File -> Build -> Windows.
This will produce a folder on your harddrive containing the EXE and other files. You must distribute the entire folder:
Corona does not produce a MSI or any other installer. If you want to make an auto-installer you need to do that on your own. There are tools on the web for this.
Yes, I was using a windows machine and I really did not know that it was possible to create an installer with these files by web tools, really roaminggamer thank you very much !! Just one last question … Is there any specific API for windows? (What I mean is: Can I have the possibility of eg renaming a file on my computer using a program made in the corona? Or are the limitations of the corona large?)
Are you asking, “Can I rename, delete, copy files on a Windows system from within a Corona program?”
If that is the question, the answer is, “Yes.”
Disclaimers:
- The end user may be running a virus scanner that could block your app. They need to ‘allow the app to access folders, etc.’ and that is on them.
- The OS will not allow you to write protected folders like the system32 and program files folders.
If the question, what API do I use? Well, I use SSK2’s file library:
- https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/
- DESKTOP SPECIFIC FEATURES: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop
- UTILITIES: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#utilities-sskfilesutil
For example. Let’s assume I have a file called “bob.png” on my desktop and I want to duplicate it and put it in “c:\mydata” which already exists.
If you have SSK2in your app, the above example would be coded like this:
-- Create the paths local src = ssk.files.desktop.getDesktopPath("bob.png") local dst = ssk.files.desktop.getDrivepath("c:/mydata/bob.png" ) -- optionally 'repair' file path dst = ssk.util.repairPath( dst ) -- The Copy ssk.files.util.cpFile( src, dst )
What is that bit about ‘repairing’ the path?
Well… in Windows, the path separator is a backslash: **
Unfortunately, a backslash () is also treated as a escape encoder. It tells Lua that the following character is special and should be re-interpreted.
- “\n” - newline
- “\r” - carriage return
- “\t” - tab
So, if you wanted to CORRECTLY encode the path on Windows you would type:
local dst = ssk.files.desktop.getDrivepath("c:\\mydata\\bob.png" )
However, I find this to be a pain in the butt and really not necessary. So, I always type paths using the forward slash: /
Additionally, my file utilities can handle either. On top of that, in case you want to print the path, I have the repair path utility to adjust the path encoding to match the current OS protocol.
Long story short, USE FORWARD SLASHES AND YOU WILL ALWAYS BE OK.
My God, it looks like my head is exploding discovering a new world of CoronaSDK hahahahahah Thank you very much, again you helped me a lot (: I think of several things that could be done … The question if I could change / rename a place file it was basically for me to know what “limit” I can achieve using CoronaSDK for desktop, but it looks like I get great deeds =) Thanks again !!