Running Compiled AppleScript from DMG Doesn't Work As a follow up for my previous question (Set the Working Folder of .app Created by Apple Script) I have the following problem.

I have an AppleScript which is Poor man's Installer:

tell me to activate

set appPath to POSIX path of (path to me as text)

set folderName to "'MyFolderName'"

set copyFolder to "cp -r " &amp; appPath &amp; folderName &amp; "'/.' '/Library/Application Support/'" &amp; folderName &amp; "'/' &amp; "

set exitScript to "exit 0;"

display dialog "Run Installer?" buttons {"Run", "Cancel"} default button 1

if the button returned of the result is "Run" then
    do shell script copyFolder &amp; exitScript with administrator privileges

    display dialog "Finished Successfully!" buttons {"OK"} default button 1

end if


So the script above is compiled into Installer.app.
Inside it I put the folder MyFolderName which contains all the sources.

I create a a DMG with the title (Also the Path) My Project.
I run Install.app from the installer and it doesn't work.
I run the Installer.app from Desktop (Or any other place on HD) and it works.

I also changed the DMG title to have no spaces MyProject and it works.

So something in the parsing of appPath into the Script doesn't work if it contains spaces.

Any idea?
As I mentioned in my answer to your other question:

Note that when using this in a do shell script command, use quoted form of to allow for spaces in the path filename.

Otherwise you'd need to escape spaces with a backslash \, and that can get messy.

Example: quoted form of appPath
You might want to do the concatenation separately and then pass it to the command.