Advertisement
GordCaswell

ShowAppIconsTimer

Nov 27th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.03 KB | None | 0 0
  1. procedure TfrmMenu.tmrShowAppIconsTimer(Sender: TObject);
  2. var
  3.   stringsAutoStart: TStrings;
  4.   strPortableAppsPath, strOptions: string;
  5.   iniSettingsFile: TINIFile;
  6.   intCounter: integer;
  7. begin
  8.   tmrShowAppIcons.Enabled:=false;
  9.     SetupButtons;
  10.   SortButtons;
  11.     DisplayButtons;
  12.  
  13.   if btnAppButton01.Visible and (frmMenu.Showing) then
  14.     btnAppButton01.SetFocus;
  15.  
  16.   if length(arrMenuItems)=0 then
  17.     GetMoreAppsClick(nil)
  18.   else
  19.     begin
  20.       if bolUpdateAutomatically then begin
  21.         bolAwaitingAutomaticUpdateProgress:=true;
  22.  
  23.       strOptions:='/STARTUP=true /MODE=UPDATE';
  24.  
  25.       if bolShowUpdaterStarupErrors then
  26.         strOptions:=strOptions + ' /STARTUPSHOWERRORS=true';
  27.  
  28.       if bolKeyboardFriendly then
  29.         strOptions:=strOptions + ' /KEYBOARDFRIENDLY=true'
  30.       else
  31.         strOptions:=strOptions + ' /KEYBOARDFRIENDLY=false';
  32.  
  33.       if bolBetaPlatformReleases then
  34.         strOptions:=strOptions + ' /BETA=true'
  35.       else
  36.         strOptions:=strOptions + ' /BETA=false';
  37.  
  38.       ShellExecute(0,'open', PChar(ExtractFileDir(Application.ExeName) + '\PortableAppsUpdater.exe'), PChar(strOptions), Nil, SW_SHOWNORMAL);
  39.     end;
  40.  
  41.   // Autorun apps
  42.   stringsAutoStart := TStringList.Create;
  43.   strPortableAppsPath := ExtractFileDir(ExtractFileDir(Application.ExeName))+'\';
  44.   iniSettingsFile:=TINIFile.Create(ExtractFileDir(Application.ExeName) + '\Data\PortableAppsMenu.ini');
  45.   try
  46.     if iniSettingsFile.SectionExists('AppsAutoStart') then
  47.     begin
  48.       iniSettingsFile.ReadSection('AppsAutoStart',stringsAutoStart);
  49.       if stringsAutoStart.Count > 0 then
  50.         for intCounter := 0 to stringsAutoStart.Count-1 do
  51.         begin
  52.           if FileExists(PChar(strPortableAppsPath+stringsAutoStart[intCounter])) then
  53.             ShellExecute(0,'open', PChar(strPortableAppsPath+stringsAutoStart[intCounter]+#0),Nil, PChar(ExtractFileDir(strPortableAppsPath+stringsAutoStart[intCounter])), SW_SHOWNORMAL);
  54.        end;
  55.     end;
  56.   finally
  57.     iniSettingsFile.Free;
  58.   end;
  59.   stringsAutoStart.free;
  60. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement