You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
#include "windows.h"
|
|
|
|
__cdecl main(int argc, char **argv)
|
|
{
|
|
char szSystemPath[_MAX_PATH];
|
|
|
|
char szFilename[_MAX_PATH];
|
|
char szCurPath[_MAX_PATH+1];
|
|
|
|
int len;
|
|
UINT dwFilename = sizeof(szFilename)/sizeof(szFilename[0]);;
|
|
DWORD dwstatus;
|
|
|
|
if (GetSystemDirectory(szSystemPath, sizeof(szSystemPath)/sizeof(szSystemPath[0])) == 0)
|
|
{
|
|
return (dwstatus = GetLastError());
|
|
}
|
|
|
|
|
|
//Get the path to the install source directory
|
|
if ((len = GetModuleFileName(NULL, szCurPath, sizeof(szCurPath)/sizeof(szCurPath[0]))) == 0)
|
|
{
|
|
return (dwstatus =GetLastError());
|
|
}
|
|
|
|
szCurPath[sizeof(szCurPath)/sizeof(szCurPath[0])-1] = '\0';
|
|
|
|
while (szCurPath[--len] != '\\')
|
|
continue;
|
|
szCurPath[len+1] = '\0';
|
|
|
|
// install the file to the system directory
|
|
dwstatus = VerInstallFile(0,"DFLAYOUT.DLL", "DFLAYOUT.DLL",
|
|
szCurPath, szSystemPath, szSystemPath,
|
|
szFilename, &dwFilename);
|
|
|
|
|
|
return dwstatus;
|
|
|
|
|
|
}
|
|
|