|
ExtractResourceToFile function
|
|
| acUtils
|
| function ExtractResourceToFile(Instance: hInst; const ResName, ResType, FileName: String;
|
| MarkAsTemporaryFile: Boolean = False): Boolean;
|
| The ExtractResourceToFile retrieves the resource, specified by ResName and ResType paremters to the FileName.
|
| // we are using this routine in AutoUpgrader
|
| procedure TacAutoUpgrader.Relaunch(const ParamStr: String);
|
| begin
|
| // writting Upgrader.exe (self upgrading module)
|
| if ExtractResourceToFile(hInstance, UpgraderModuleName, UpgraderModuleName, UpgraderFileName, True) then
|
| begin
|
| // start self-upgrading mechanism
|
| WinExec(PChar(UpgraderFileName + ' ' + Application.ExeName + ' ' + ParamStr), SW_SHOWNORMAL);
|
|
|
| FRestarting := True;
|
| if Assigned(FOnDoOwnCloseAppMethod) then
|
| FOnDoOwnCloseAppMethod(Self)
|
| else
|
| ShutdownApplication;
|
| end;
|
| end;
|
| LoadResourceToStream function.
|