Page 1 of 1

File Bag Permissions issue

Posted: Mon Oct 30, 2006 5:27 pm
by andrereg
I am having a problem accessing a file i have included via "File Bag" during a "Run Program" call.
The program i am trying to run is OSQL (MS SQL Server).

Msg 3201, Level 16, State 2, Server SERVER, Line 1
Cannot open backup device 'C:\\DOCUME~1\\MyUserAccount\\LOCALS~1\\Temp\\mia23.tmp\\data\\Microsoft .NET Framework 2.0\\mFileBagIDE.dll\\bag\\Database.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Server SERVER, Line 1
RESTORE DATABASE is terminating abnormally.

When i go out to inspect that file and look at the security rights on it, (while the setup package is running)
"MyUserAccount" shows up in the list with the following grants:
[Full Control, Modify, Read & Execute, Read, Write]

"MyUserAccount" is in the administrators group on this machine.
I am using InstallAware Studio version 6.0.6 (SP03).
I've tried this with both "Run Program" and "Run Program As"

I looked at Windows Task Manager while setup was running and saw OSQL running as "MyUserAccount"

When i use "Run Program", it should be running as the currently logged in user account, right?

any idea what i'm doing wrong?
thanks,
drew

Posted: Tue Oct 31, 2006 9:52 am
by Gizm0
It's a stupid behavior from SQL Server.. Even if you have an account named "test" on both machines, they have a different GUID, and you get an error. Best practice is to add the .bak file with "Everyone" permission (Read/write) etc and protect it with a Media password, so noone can restore it without a password. Execute the rest of the steps as you do now and it will work..

Posted: Wed Nov 01, 2006 11:00 am
by andrereg
Thanks for the help!

at first i didn't realize that the account running the SQL Service (which was not an administrator) was the one who had to have access to the backup file, NOT the logged-in account, which was running OSQL.

your suggestion took care of the problem easily.

thanks again,
drew

Posted: Wed Nov 01, 2006 2:13 pm
by Gizm0
No prob, happy to help you!
Have fun with InstallAWARE! :)