#include <windows.h>
typedef struct _AdvancedDllStruct
{
int (
WINAPI *AddedFile)(char *lpFileName);
int (
WINAPI *AddedKey)(HKEY hKeyRoot,char *lpPath);
int (
WINAPI *AddedValue)(HKEY hKeyRoot,char *lpPath,char *lpValueName);
int (
WINAPI *AddShared)(char *lpSharedFile);
int (
WINAPI *BackupFile)(char *lpFileName);
int (
WINAPI *CreateDirectory)(char *lpDirectory);
char * lpCommandLine;
HBITMAP hbmDialog;
BOOL bSilent;
DWORD *lpdwFlags;
char *(
WINAPI *GetVariableString)(char *lpVariable);
int (
WINAPI *GetVariableInt)(char *lpVariable);
int (
WINAPI *SetVariableString)(char *lpVariable,char *lpValue);
int (
WINAPI *SetVariableInt)(char *lpVariable,int iValue);
} AdvancedDllStruct;
AdvancedDllStruct *g_pADS = NULL;
long
WINAPI AdvancedEntry(AdvancedDllStruct *lpAdvancedDllStruct)
{
g_pADS = lpAdvancedDllStruct;
return 1;
}
long
WINAPI OnMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, long lDialogId)
{
if (lDialogId == 7 && uMsg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK)
{
char szParentDirectory[MAX_PATH] = {0};
GetDlgItemText(hWnd, 10, szParentDirectory, MAX_PATH);
if (strchr(szParentDirectory, '\\') != strrchr(szParentDirectory, '\\') && szParentDirectory[strlen(szParentDirectory) - 1] == '\\')
szParentDirectory[strlen(szParentDirectory) - 1] = 0;
if (strrchr(szParentDirectory, '\\') != NULL)
*strrchr(szParentDirectory, '\\') = 0;
g_pADS->SetVariableString("<InstallDirParent>", szParentDirectory);
}
return 0;
}