EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElZipReader Unzip On ProgramFiles Dir

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#23801
Posted: 02/27/2013 19:55:37
by Eduardo Tijerina (Basic support level)
Joined: 11/06/2009
Posts: 6

Hi.-

How can I unzip a file/dir in the ProgramFilesDir?
I'm getting the create file error even with my
app having admin priv.

TIA for your help.
#23802
Posted: 02/28/2013 00:25:55
by Eugene Mayevski (EldoS Corp.)

1) Does the same operation work with some other folder? If you have not tested this, please do. This will confirm that the problem is with the folder and not with some other factor.
2) How exactly are you specifying the path? Please show the line of code. This will ensure that the path is provided correctly.

The components don't distinguish the given folder from any other folder, so whatever restriction exists, it is external to the component. Maybe you need to tune up the manifest to ensure that the application runs with administrative rights.


Sincerely yours
Eugene Mayevski
#23827
Posted: 02/28/2013 11:29:54
by Eduardo Tijerina (Basic support level)
Joined: 11/06/2009
Posts: 6

1) Does the same operation work with some other folder? Yes, already tested, like 'C:\Whatever\MyApp'.

2) Path is provided correctly, tried with DOS format with same result.
try
FZipReader.Open('MyZip.zip', True);
try
FZipReader.Extract('', 'C:\Program Files\MyAppDir');
// FZipReader.Extract('', 'C:\Progra~1\MyAppDir');
finally
FZipReader.Close;
end; // try
except
on E: Exception do
ShowMessage(E.Message);
end; // try

3) Manifesto was tuned to ensure that the application runs with administrative rights, the problem persists.

Hope this helps,
TIA
#23828
Posted: 02/28/2013 11:35:08
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

Its definitely a permission problem. C:\Program Files\* folders are usually write-protected for regular users. Try to run the program using "Run As..." menu and specifying administrator account.
#23830
Posted: 02/28/2013 11:40:46
by Eugene Mayevski (EldoS Corp.)

Also you can do the following simple test: before calling Extract, try to create an instance of TFileStream class (with fmCreate open mode) with the path "C:\Program Files\MyAppDir\anything". See if the stream and the file are created correctly.


Sincerely yours
Eugene Mayevski
#23833
Posted: 02/28/2013 11:50:43
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

And, just in case, MyAppDir should already exist in Program Files folder.
#23835
Posted: 02/28/2013 11:52:52
by Eduardo Tijerina (Basic support level)
Joined: 11/06/2009
Posts: 6

Hi,

That was it, permission problem solved!

Thanks.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 653 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!