delphi - Service cannot access folder -
i've made service backups of firebird databases using delphi. service gets destination dir , create fbk file using gbak. works in directory except of "google drive" directory, , don't know how solve it.
when execute gbak separately service, works don't know going wrong
here's code
if not fileexists(getenvironmentvariable('programdata') + '\my\' + nombre) try fillchar(seinfo, sizeof(seinfo), 0); seinfo.cbsize := sizeof(tshellexecuteinfo); seinfo begin fmask := see_mask_nocloseprocess; wnd := 0; lpfile := pwidechar(regquerystringvalue('software\firebird project\firebird server\instances', 'defaultinstance') + 'bin\gbak.exe'); nshow := sw_hide; lpparameters := pwidechar('-v -t -user sysdba -password "masterkey" ' + '"' + getenvironmentvariable('programdata') + '\my\' + nombre + '"'); end; if shellexecuteex(@seinfo) begin repeat getexitcodeprocess(seinfo.hprocess, exitcd); until (exitcd <> still_active) or (terminated); end; except on e: exception begin if getlasterror <= 32 begin case getlasterror of 0, se_err_oom: inserterror('outmem', error_1); error_file_not_found: inserterror('gmiss', error_2); error_path_not_found: inserterror('path', error_3); error_bad_format: inserterror('gbreak', error_4); se_err_accessdenied: inserterror('accx', error_5); se_err_noassoc, se_err_associncomplete: inserterror('badfile', error_6); se_err_ddebusy, se_err_ddefail, se_err_ddetimeout: inserterror('dde', error_7); se_err_share: inserterror('share', error_8); else inserterror('unkn', error_9); end; mybackup.status := csstopped; exit; end else begin inserterror(e.classname, e.message); mybackup.status := csstopped; exit; end; end; end;
google drive restricts access folder user created folder. service runs localsystem. check folder permissions (properties / security)
Comments
Post a Comment