|
-
March 16th, 2009, 09:41 PM
#1
How to know if exe was run from a zip archive?
I need to know if my program was run from a ZIP archive. Is it possible to do so?
-
March 17th, 2009, 02:07 AM
#2
Re: How to know if exe was run from a zip archive?
may be you can find that out by looking at parent process, if you can somehow know that the exe that run that process is a zip program.
http://www.codeproject.com/KB/threads/ParentPID.asp
Regards,
Ramkrishna Pawar
-
March 17th, 2009, 07:54 AM
#3
Re: How to know if exe was run from a zip archive?
if you can somehow know that the exe that run that process is a zip program.
There are too many different zip programs.
I need to know if my program was run from a ZIP archive.
Why ?
-
March 17th, 2009, 09:20 AM
#4
Re: How to know if exe was run from a zip archive?
If your exe is located in the windows temp folder, it might indicate it was extracted there by a zip tool. But I would not rely on this to make any important decisions regarding how my exe should behave...
Nobody cares how it works as long as it works
-
March 17th, 2009, 07:09 PM
#5
Re: How to know if exe was run from a zip archive?
 Originally Posted by zerver
If your exe is located in the windows temp folder, it might indicate it was extracted there by a zip tool. But I would not rely on this to make any important decisions regarding how my exe should behave...
Yeah, but how can you tell that the directory is temp?
 Originally Posted by Skizmo
Why ?
The program puts itself into Windows auto run key if user selects so, thus it'd be desirable for the exe to be located in the permanent folder. Unfortunately many people run it right from the ZIP file.
 Originally Posted by Krishnaa
may be you can find that out by looking at parent process
I don't think there're any parent processes, or maybe actually Windows Explorer is the one.
I thought maybe the file/folder it was put in will have the FILE_ATTRIBUTE_COMPRESSED or FILE_ATTRIBUTE_ENCRYPTED, or some special attribute. But that doesn't seem to be the case.
-
March 18th, 2009, 04:46 AM
#6
Re: How to know if exe was run from a zip archive?
 Originally Posted by ahmd
Yeah, but how can you tell that the directory is temp?
The program puts itself into Windows auto run key if user selects so, thus it'd be desirable for the exe to be located in the permanent folder. Unfortunately many people run it right from the ZIP file.
GetTempPath http://msdn.microsoft.com/en-us/libr...92(VS.85).aspx
I suggest you simply don't put it in autorun if the folder is temporary...
Nobody cares how it works as long as it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|