1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89:
| procedure TQipPlugin.UpdateCheck; var ini : TIniFile; FiPfad : string; FTPVersion : string; SelfVersion : string; APath : string; Updater : string; z : integer; PunktPos : integer; iFTPVersion : integer; Plugin_FTPVersion_Major : integer; Plugin_FTPVersion_Minor : integer; begin FTPVersion := GetHTML('http://version.txt'); PunktPos := pos('.',FTPVersion); Plugin_FTPVersion_Major := strtoint(copy(FTPVersion,1,PunktPos-1)); Plugin_FTPVersion_Minor := strtoint(copy(FTPVersion,PunktPos+1,length(FTPVersion))); FTPVersion := StringReplace(FTPVersion, '.', '', [ rfReplaceAll ]); if not TryStrToInt(FTPVersion, iFTPVersion) then begin end else begin if ((Plugin_FTPVersion_Major <> PLUGIN_VER_MAJOR) or (Plugin_FTPVersion_Minor <> PLUGIN_VER_MINOR)) then begin SelfVersion:=inttostr(PLUGIN_VER_MAJOR)+'.'+inttostr(PLUGIN_VER_MINOR); case MessageBox(Handle,PChar(PChar(string(PLUGIN_NAME))+' Plugin:'+#10#13+#10#13+PChar('An Update is available')+#10#13+#10#13+PChar('New Version:')+' '+PChar(FTPVersion)+#10#13+PChar('Old Version:')+' '+PChar(SelfVersion)+#10#13+#10#13+PChar('Do you want to close QIP Infium now and install the plug?')),PChar('Info'),0 OR MB_OKCANCEL OR MB_DEFBUTTON1) of IDCANCEL: begin end; IDOK: begin FfrmMain.ListBox100Create;
APath:=ExtractFilePath(FDllPath); APath:=ExcludeTrailingPathDelimiter(ExtractFilePath(ExcludeTrailingPathDelimiter(APath))); FfrmMain.ListBox100.Clear; FindFiles (APath, '*.exe', False, FfrmMain.ListBox100.Items); for z:=0 to FfrmMain.Listbox100.Count-1 do begin Updater := FfrmMain.ListBox100.Items.Strings[z]; end;
FfrmMain.ListBox100.Destroy; if FileExists(Updater) then begin FiPfad := APath+'\updater.ini'; ini := TIniFile.Create(FiPfad); ini.WriteString('Main','PluginName',PLUGIN_NAME); ini.WriteString('Plugins',PLUGIN_NAME+'_FTPVerPfad','http://diamonddog.jeak.de/infium/onlineip/onlineip_version.txt'); ini.WriteString('Plugins',PLUGIN_NAME+'_RarPfad','http://diamonddog.jeak.de/infium/onlineip/OnlineIP'); ini.Free; ShellExecute(Handle, nil, PChar(Updater), nil, nil, SW_SHOWNORMAL); PlugMsg1.Msg := PM_PLUGIN_INFIUM_CLOSE; PlugMsg1.WParam := LongInt(0); PlugMsg1.DllHandle := FDllHandle; FPluginSvc.OnPluginMessage(PlugMsg1); end else begin ShowMessage('Error: No Updater found.'+#10#13+'Pleas go on:'+#10#13+'http://www.DiamondDog.de.tt'+#10#13+'and install the Updater in the Folder "Plugins"'); end; end; end; end else begin end; end; |