I have no idea why Windows 7 (and Vista) have decided that an Admin level user is not allowed to write files into Program Files, but apparently Windows knows better than I do what should happen in that folder.

Unfortunately, if you working with PhoneGap and building your app for BlackBerry, the default install locations for the BlackBerry WebWorks Packager is under Program Files and the PhoneGap build scripts copy the compiled COD files into the appropriate simulator folder under the webworks\simpacks folder.

After trying in vain to unset the readonly permissions on the simpacks folder under my normal account (which has admin privileges) I finally tried enabling the administrator account, logging in as administrator and then unsetting readonly on that folder. That didn’t work either. The Administrator user is able to run the build scripts just fine, but when I log out and back in as my normal user the folders are back to read only.

I even tried making my user the owner of those folders (per a blog post somewhere) and that didn’t work either. The PhoneGap build script (and just a regular copy command) get “access denied”.

I finally realize I just needed to run CMD as Administrator and my builds would work. So if you need to run PhoneGap build scripts in Windows 7 as a real user, just launch the Command Prompt as Administrator (right click on the Command Prompt icon and choose Run as Administrator). Now your builds will happily copy the compiled files to the simulator folder under Program Files.

3 Comments on “PhoneGap, BlackBerry and Windows 7 – Access Denied!”

Hello.. just stumbled upon this blog by chance and realized that you installed our office network many years ago. Nevertheless, I have seen the topic at hand regarding the default install “program files” location discussed at length in other forums. One solution was to create your own folder outside of “program files” and point the install program there. Does the WebWorks packager allow that flexibility?

Yes, you can install WebWorks to another folder to avoid the Program Files issue, but I typically like to keep the default installation locations so that the docs all match up and so that when I’m helping a client troubleshoot their issues I will have the most “plain vanilla” setup I can to match what they likely have.

Yes I can understand that aspect too. I guess MS had a reason for locking down “program files” so tightly. Almost everything with Vista and Windows 7 is now security driven. It would be nice to see Ubuntu and other Linux based OS’s become more widely accepted alternatives to Windows. But like most things, the industry follows the money $$.. Also, the support realm with Linux can be intimidating for some users who aren’t as savvy.