Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVersion=1.5
- DefaultDirName={pf}\My Program
- OutputDir=userdocs:Inno Setup Examples Output
- [Code]
- function GetWindowsUpdateCount: Integer;
- var
- SearchResult: Variant;
- UpdateSession: Variant;
- UpdateSearcher: Variant;
- begin
- UpdateSession := CreateOleObject('Microsoft.Update.Session');
- UpdateSession.ClientApplicationID := 'My Inno Setup Installer';
- UpdateSearcher := UpdateSession.CreateUpdateSearcher;
- SearchResult := UpdateSearcher.Search('IsInstalled=0 and Type=''Software'' and IsHidden=0');
- Result := SearchResult.Updates.Count;
- end;
- procedure InitializeWizard;
- var
- UpdateCount: Integer;
- begin
- UpdateCount := GetWindowsUpdateCount;
- MsgBox(IntToStr(UpdateCount), mbInformation, MB_OK);
- end;
Advertisement
Add Comment
Please, Sign In to add comment