How can I find an exe file is installtion excludable file or not?
How can I f开发者_StackOverflow社区ind an exe file is setup file or not ?
for example :
bool isSetupFile = IsSetup(@"C:\KasperSkySetup.exe");
regards
It'd require a very complex and error-prone heuristic to tell whether an executable is an installation package or not.
In general, the answer is no, you cannot do that.
Additional reading:
http://blogs.msdn.com/b/oldnewthing/archive/2010/07/26/10042389.aspx
A setup file could be created by anyone and is a program like any other. But you could probably find some common header bytes for the files if they are created by a popular installer program like Wise.
Information on installer programs (not .msi based) can be found at: http://www.installsite.org/pages/en/tt_nonmsi.htm
精彩评论