Hello Everyone,
I'm just getting ready to create my first little standalone, and just recently learned about splash screen.
In this case, I already made the main part of the program as a mainstack, and now I've created a splash screen as a separate mainstack.
My question is no doubt a very basic one, but how do I turn the main part of the program into a substack and then attach it as a substack to my splash screen stack?
Thanks as always, deeverd
Turning a Mainstack into a Substack for another Stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi,
the main benefit of a splash screen approach is, that you do not need to make your main application a substack. This will allow you to save the application stack if you want to do that and has some other benefits besides that (think of automated updates) All you will need to do is make your splash screen load the other stack with a single command
go stack "path/to/stack"
all messages that are not the startUp message will be sent to your stack. Most of the time you will want to make your splash screen install your main application to a place where you can find it easiely and in a location you know you should be able to write to. Take a look at specialfolderpath in the dictionary and visit Ken Rays site
http://www.sonsothunder.com/devres/revo ... ile010.htm
If you are already familiar with custom properties you can write a suckUp / spit out script that will allow you to make your main application stack a custom property of your splash screen that you then can write back to the location you chose on first launch of your application on a users machine.
If you have any questions regarding the process please ask.
All the best,
Malte
the main benefit of a splash screen approach is, that you do not need to make your main application a substack. This will allow you to save the application stack if you want to do that and has some other benefits besides that (think of automated updates) All you will need to do is make your splash screen load the other stack with a single command
go stack "path/to/stack"
all messages that are not the startUp message will be sent to your stack. Most of the time you will want to make your splash screen install your main application to a place where you can find it easiely and in a location you know you should be able to write to. Take a look at specialfolderpath in the dictionary and visit Ken Rays site
http://www.sonsothunder.com/devres/revo ... ile010.htm
If you are already familiar with custom properties you can write a suckUp / spit out script that will allow you to make your main application stack a custom property of your splash screen that you then can write back to the location you chose on first launch of your application on a users machine.
If you have any questions regarding the process please ask.
All the best,
Malte
Thank you Malte. The "Tips and Tricks" section at the Sons of Thunder site is a great resource. I'm glad you gave me a link to it.
I still have some confusion:
Also...
All the best, deeverd
I still have some confusion:
How does a standalone path work? In other words, while I'm building a stack, I know I have to give the program precise instructions on where to find the .rev substack file on my computer, but how does one tell the splash screen how to find the main application when they are bundled together in a standalone application on software that is being installed on somebody else's computer? Where do you tell it to look?go stack "path/to/stack"
Also...
The custom properties that you are talking about is not something I understand at this point in time, but from what you are saying, I can see that it is vital that I learn to understand it. I think this was mentioned in the Dan Shafer book in the last chapter or thereabouts, so I'll dust it off and refer to it right away, as well as look up custom properties in the Rev 2.7 documentation.If you are already familiar with custom properties you can write a suckUp / spit out script that will allow you to make your main application stack a custom property of your splash screen that you then can write back to the location you chose on first launch of your application on a users machine.
All the best, deeverd
Hi deeverd,
please excuse the late reply. I am pretty much on the road these days doing consultancy.
As for your question for the standalone path (please forgive me that I was not precise enough in my previous post):
I would make the splash screen (the executable) a basic installer. So your splash screen would always know where it has put the components it needs. Think of a preference file:
Same thing holds true for other components. Look where you want to write them (Application support folder can make sense for example on MAc system) and save your components there. Kens site will give you the correct folder paths. You can make the Splash screen carry stack files as custom properties that you then can write to the end users disk if they are not present, or if they are present load from the specified location.
Hope that helps a bit.
Malte
please excuse the late reply. I am pretty much on the road these days doing consultancy.
As for your question for the standalone path (please forgive me that I was not precise enough in my previous post):
I would make the splash screen (the executable) a basic installer. So your splash screen would always know where it has put the components it needs. Think of a preference file:
Code: Select all
on openPrefs
--example
-- Win specialfolderpath(26)/myApp/myApp.dat
-- Mac specialfolderpath("preferences")/myApp/myApp.dat
try
global gMyPrefsPath
local specialFolder,tPrefs,tTopStack
put the topstack into tTopStack
switch the platform
case "MacOS"
put specialfolderpath("preferences") into specialFolder
break
case "Win32"
if word 1 of the systemversion = "NT" then
-- Windows NT,2000,XP and Vista
put specialfolderpath(26) into specialFolder
else
-- Win 95,98 and ME
put specialfolderpath("system") into specialFolder
end if
if "U3" is in the globals then
-- Run from U3 USB-Stick
put $U3_APP_DATA_PATH into specialFolder
end if
break
default
-- All nixes
put $Home into specialFolder
break
end SWITCH
if there is not a folder (specialFolder & "/myApp") then create folder (specialFolder & "/myApp")
if there is no stack (specialFolder & "/myApp/myApp.dat") then
lock messages
create invisible stack "myApp.dat"
save stack "myApp.dat" as (specialFolder & "/myApp/myApp.dat")
unlock messages
else
open invisible stack (specialFolder & "/myApp/myApp.dat")
end if
set the defaultstack to tTopStack
catch theerror
return "error: "&theError
end TRY
end openPrefs
Hope that helps a bit.
Malte
Wow and Thanks
Hello Malte,
Yes, thank you very much, because the information above is extremely helpful and I'm finally starting to understand the whole standalone concept. No problem with your late reply, since often it's a week or more before I can get back on the forum due to work and university and home demands.
Just in case anyone even newer at programming than me (hard to imagine) is following this thread concerning standalone program information, I thought I'd just mention that I kept experimenting until I found out how to turn any mainstack into a substack for any other mainstack. What I found was that all I had to do was to open up a stack in Revolution Media or Studio, go to the application browser and then right click (I'm using Windows XP) on the mainstack symbol that I want to convert to a substack. By going to the Properties editor, specifically to the first "basic" page, I found that there is a button in there that allows me to scroll and find the name of the stack that I want to attach it to. Actually, it's very easy.
I also found out that a simple standalone compiles very effortlessly with Studio by merely pressing the second "standalone" button under the file menu. Granted, I know there's a lot more to it to make it a stack that can be automatically updated or that includes databases and unusal fonts, but so far so good anyway.
Now, I'm looking forward to applying Malte's excellent advice and making my programs much more professional.
Cheers, deeverd
Yes, thank you very much, because the information above is extremely helpful and I'm finally starting to understand the whole standalone concept. No problem with your late reply, since often it's a week or more before I can get back on the forum due to work and university and home demands.
Just in case anyone even newer at programming than me (hard to imagine) is following this thread concerning standalone program information, I thought I'd just mention that I kept experimenting until I found out how to turn any mainstack into a substack for any other mainstack. What I found was that all I had to do was to open up a stack in Revolution Media or Studio, go to the application browser and then right click (I'm using Windows XP) on the mainstack symbol that I want to convert to a substack. By going to the Properties editor, specifically to the first "basic" page, I found that there is a button in there that allows me to scroll and find the name of the stack that I want to attach it to. Actually, it's very easy.
I also found out that a simple standalone compiles very effortlessly with Studio by merely pressing the second "standalone" button under the file menu. Granted, I know there's a lot more to it to make it a stack that can be automatically updated or that includes databases and unusal fonts, but so far so good anyway.
Now, I'm looking forward to applying Malte's excellent advice and making my programs much more professional.
Cheers, deeverd