Installing additional 3rd party components
Previous Top Next

Applications using Thinstall's installer can perform additional steps needed during installation by checking for the presence of the Environment Variable " TS_INSTALL=1" during execution. To install an additional 3 rd party setup.exe program, for example:

if (GetEnvironmentVariable("TS_INSTALL", buffer, sizeof(buffer))
{
PROCESS_INFORMATION pinfo;
STARTUPINFO sinfo;
DWORD ecode;

sinfo.cb=sizeof(sinfo);
GetStartupInfo(&sinfo);
CreateProcessA(0, "3rd_party_setup.exe", 0, 0, 0, 0, 0, 0, &sinfo, &pinfo);

WaitForSingleObject(pinfo.hProcess, INFINITE);
GetExitCodeProcess(pinfo.hProcess, &ecode);
If (ecode!=0)
show_error();
}

When your application is run the 1 st time after installation, the Environment variable TS_INSTALL will be set. This environment variable will be missing from subsequent runs of your application. Since Thinstall can execute EXE files bundled inside your archive, there is no need to extract the 3 rd _party_setup.exe program to disk before executing it. If your application is copied to a new computer and run, the installer will be invoked again, TS_INSTALL will be set on the first run - and you can be assured the 3rd_party_setup.exe program will be available because it is built into your EXE.