Encryption of a script-only stack in a standalone
Posted: Thu Dec 14, 2017 11:18 am
I'm trying to use a script-only stack for development, but encrypted when in a standalone.
I'm using this script (some lines are useless):
The problem is that I get the warning "Could not auto-detect inclusions or security categories because stack is password protected". It's because after savingstandalone, stack "mytest" has a password.
If I remove it at the end of savingstandalone, mytest.livecode isn't encrypted.
Any idea how to fix it?
I'm using this script (some lines are useless):
Code: Select all
on preopenstack
if the environment is "development" then
start using stack "mytest.livecodescript"
else
start using stack "mytest.livecode"
end if
set the destroyStack of stack "mytest" to true
end preopenstack
on savingstandalone
local theFilename, pwd
if the scriptOnly of stack "mytest" then
stop using stack "mytest.livecodescript"
set the scriptOnly of stack "mytest" to false
put uuid() into pwd
set the password of stack "mytest" to pwd
put the filename of stack "mytest" into theFilename
set the itemDelimiter to "."
put "livecode" into the last item of theFilename
set the filename of stack "mytest" to theFilename
delete file theFilename
save stack "mytest"
close stack "mytest"
start using stack "mytest.livecode"
set the passkey of stack "mytest" to pwd
delete file theFilename
end if
end savingstandalone
on standaloneSaved pFolder
set the password of stack "mytest" to empty
end standaloneSaved
If I remove it at the end of savingstandalone, mytest.livecode isn't encrypted.
Any idea how to fix it?