G
Guest
Hello,
I have the following code in evc++ and I'm trying to create a MSI (following the example on msdn, with a few changes). The file gets compiled fine and works like a charm if I run in on its own from the directory where all the ini files reside.
I then put the exe as an "Install" custom action in the MSI Setup Project, with no line arguments. When I run the MSI the exe actually runs from c:\windows\system32 and therefore fails to load the ini files. i want it to run from the application folder. Is there any way I can change the custom action or the code below for it to function properly?
//Start ActiveSync with the given of default .ini file as a parameter
char currentDirectory[MAX_PATH];
::GetCurrentDirectory(MAX_PATH, currentDirectory);
char iniPath[MAX_PATH];
strcpy(iniPath, "\"");
strcat(iniPath, currentDirectory);
strcat(iniPath, "\\setup.ini\"");
strcat(iniPath, " ");
strcat(iniPath, "\"");
strcat(iniPath, currentDirectory);
strcat(iniPath, "\\setup1.ini\"");
_execl(strActuveSyncPath, strActuveSyncPath, iniPath, NULL);
return 0;
}
I have the following code in evc++ and I'm trying to create a MSI (following the example on msdn, with a few changes). The file gets compiled fine and works like a charm if I run in on its own from the directory where all the ini files reside.
I then put the exe as an "Install" custom action in the MSI Setup Project, with no line arguments. When I run the MSI the exe actually runs from c:\windows\system32 and therefore fails to load the ini files. i want it to run from the application folder. Is there any way I can change the custom action or the code below for it to function properly?
//Start ActiveSync with the given of default .ini file as a parameter
char currentDirectory[MAX_PATH];
::GetCurrentDirectory(MAX_PATH, currentDirectory);
char iniPath[MAX_PATH];
strcpy(iniPath, "\"");
strcat(iniPath, currentDirectory);
strcat(iniPath, "\\setup.ini\"");
strcat(iniPath, " ");
strcat(iniPath, "\"");
strcat(iniPath, currentDirectory);
strcat(iniPath, "\\setup1.ini\"");
_execl(strActuveSyncPath, strActuveSyncPath, iniPath, NULL);
return 0;
}