Getting version string for standalone app
Sarah Reichelt
sarah.reichelt at gmail.com
Mon Aug 21 20:39:31 EDT 2006
> > I want to work the other way around. I want to be able to set a
> > version number in my application and have it transfer this to all the
> > various settings in the Standalone Builder. So far laziness has won
> > and I haven't actually done anything about this, but you never know, I
> > might get there in the end.
>
> Now you can -- just make a handler that sets the
> cRevStandaloneSettings[<version you want>] of the stack. This should
> work fine during development.
OK, here it is. It wasn't difficult, but finding all the properties
that had to be set was tedious, so I thought other people might like
to share the handler:
on setVersionNum
put the cProgramVersion of this stack into tVersion
ask info "Enter the new version number:" with tVersion
if it is empty then exit to top
put it into tNewVersion
set the cProgramVersion of this stack to tNewVersion
-- OS X settings
put the cRevStandaloneSettings["OSX,info"] of this stack into tInfo
put tNewVersion into last word of tInfo
set the cRevStandaloneSettings["OSX,info"] of this stack to tInfo
put the cRevStandaloneSettings["OSX,longVersion"] of this stack into tInfo
put tNewVersion into last word of tInfo
set the cRevStandaloneSettings["OSX,longVersion"] of this stack to tInfo
set the cRevStandaloneSettings["OSX,shortVersion"] of this stack
to tNewVersion
-- Windows settings
put the cRevStandaloneSettings["Windows,FileDescription"] of this
stack into tInfo
put tNewVersion into word -3 of tInfo
set the cRevStandaloneSettings["Windows,FileDescription"] of this
stack to tInfo
-- split Windows version up into 4 separate bits
put ".0.0.0" after tNewVersion -- make sure it has enough
set the itemdel to "."
put item 1 of tNewVersion into tVersion1
put item 2 of tNewVersion into tVersion2
put item 3 of tNewVersion into tVersion3
put item 4 of tNewVersion into tVersion4
set the cRevStandaloneSettings["Windows,fileversion1"] of this
stack to tVersion1
set the cRevStandaloneSettings["Windows,fileversion2"] of this
stack to tVersion2
set the cRevStandaloneSettings["Windows,fileversion3"] of this
stack to tVersion3
set the cRevStandaloneSettings["Windows,fileversion4"] of this
stack to tVersion4
set the cRevStandaloneSettings["Windows,productversion1"] of this
stack to tVersion1
set the cRevStandaloneSettings["Windows,productversion2"] of this
stack to tVersion2
set the cRevStandaloneSettings["Windows,productversion3"] of this
stack to tVersion3
set the cRevStandaloneSettings["Windows,productversion4"] of this
stack to tVersion4
save this stack
end setVersionNum
It deals with OS X & Windows only, but could easily be expanded to
accomodate others. This works on Rev 2.7.3 but I haven't tested it on
anything else, so use at your own risk :-)
Cheers,
Sarah
More information about the use-livecode
mailing list