First, try this manually.
Publish the application to a folder (set the publish location to something like C:\publish, and the installation URL correctly, like http://myserver/myapp/).
Then go in and rename Application Files to ApplicationFiles in C:\publish.
Go to the C:\publish\ApplicationFiles\yourapp_a_b_c_d\ folder and delete yourapp.application. (Trust me, if you don't, mageui will crap out when you re-add the files).
Run MageUI (it's in c:\program files\microsoft sdks\windows\v7.0a\bin or v6.0a\bin, depending on which version of VS you are running).
In MageUI, click Open, look for c:\publish\ApplicationFiles\yourapp_a_b_c_d\yourapp.exe.manifest and open it (where a_b_c_d is your version and yourapp is your application name).
You should see the name and stuff. Click on Files. Make sure "when populating add the deploy extension..." is checked, then click Populate (although come to think of it, all should have that extension, unless you changed it in VS). This will add all of the files in the folder to the application manifest/
Save and sign the application manifest.
Then clck Open again, open c:\publish\yourapp.application.
Click "Application Reference". On the right, click Select Manifest. Browse to the one you just edited (C:\publish\ApplicationFiles\yourapp_a_b_c_d\yourapp.exe.manifest). This updates the deployment manifest so it can find the list of files in the right application manifest. Save and sign the deployment manifest (yourapp.application).
Copy the folders to the webserver, it should work.
Now, if that does work for you, you can replace the mageui stuff with Mage commands, and probably do some simple scripting to copy the files to the new folder or rename the "Application Files" to "ApplicationFiles".
I can provide the Mage commands for you if you need them.