1 - You probably cannot change the setup.exe during installation, because it is in use by that time
2 - Renaming the program won't help, because that is the key to the whole thing. Windows Setup starts "setup.exe" and I don't think we can change that.
I slipstreamed SP2RC2 yesterday and did not have such a problem. I have to check it again, maybe SFC is turned off in my unattended CD.
BTW: I don't have the original sourcecode anymore, I changed it around a bit since I wrote my little guide. Here is my current version:
#include "windows.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
SHELLEXECUTEINFO mySHELLEXECUTEINFO;
mySHELLEXECUTEINFO.cbSize=sizeof(SHELLEXECUTEINFO);
mySHELLEXECUTEINFO.fMask=SEE_MASK_NOCLOSEPROCESS;
mySHELLEXECUTEINFO.hwnd=NULL;
mySHELLEXECUTEINFO.lpVerb="Open";
mySHELLEXECUTEINFO.lpFile="cmd.exe";
mySHELLEXECUTEINFO.lpParameters="/C setup.cmd";
mySHELLEXECUTEINFO.lpDirectory=".";
mySHELLEXECUTEINFO.nShow=NULL; // or SW_SHOW;
ShellExecuteEx(&mySHELLEXECUTEINFO);
WaitForSingleObject(mySHELLEXECUTEINFO.hProcess,INFINITE);
return 0;
}
The main difference is that I don't start setupORG.exe directly anymore but from the setup.cmd (formerly presetup.cmd). That gives me a bit more flexibility and helps in producing silent installation packages.
I use mingw for my small compiling needs:
gcc -mwindows -Os -s -o setup.exe setup.cpp
That's it.
--
Pyron