Problem setting password when build standalone

Dave dave at
Mon Jul 7 06:22:38 EDT 2008

Hi All,

I'm trying to password protect my application. The application is  
setup so that when it is built as a standalone, there is a small  
application file (.app or .exe) which holds the standalone settings,  
acts as a "Splash Screen" and has code triggered by the  
"savingStandalone" and "standaloneSaved" messages which copies files  
into the correct folders in the Standalone Folder structure. When the  
application is launched it just displays a Splash Screen and then  
runs .rev files that are located in a folder called "RunTime/Stacks".  
The RunTime folder is either inside the .app bundle on Macs or in the  
same folder as the .exe file on Windows.

This all works fine and I just want to add password protection to  
the .rev files once they have been copied.

To do this I use the following code, I've stepped through it and all  
the paths etc. seem ok and it runs without error the first time,  
however this code is called twice, once for Mac and once for Windows.  
When processing Windows I get an error saying that stack "X" is  
already in memory and do I want to purge it, save it or cancel. I've  
added code below to set the "destroyStack" property to true, but I  
still get the error.

Anyone have any ideas of how I can get around this?

All the Best

  put kApplicationPassword into myApplicationPassword
   put StackFileGetFileList(myRunTimeStacksFolderPathName) into  
   set the itemDelimiter to "."
   repeat for each line myRunTimeStackFileName in myRunTimeStackFileList
     if item -1 of myRunTimeStackFileName <> "rev" then next repeat

     put myRunTimeStacksFolderPathName & myRunTimeStackFileName into  
     set the password of stack myRunTimeStackFilePathName to  
     save stack myRunTimeStackFilePathName

     set the destroyStack of stack myRunTimeStackFilePathName to true
     close stack myRunTimeStackFilePathName
   end repeat

More information about the use-livecode mailing list