Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Components]
- Name: "common"; Description: "Common files"; Types: Psi+ Psi+WebKit
- Name: "libs32"; Description: "Libs for x32"; Types: Psi+ Psi+WebKit
- Name: "plugins32"; Description: "Psi+ plugins x32"; Types: Psi+ Psi+WebKit
- Name: "bin32"; Description: "Psi+ binary x32"; Types: Psi+
- Name: "bin32w"; Description: "Psi+ binary webkit x32"; Types: Psi+WebKit
- [Languages]
- Name: "english"; MessagesFile: "compiler:Default.isl"
- Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
- Name: "french"; MessagesFile: "compiler:Languages\French.isl"
- [Setup]
- #define AppVer "1.0." + GetDateTimeString('yyyy/mm/dd', '.', '')
- AppName=Psi+
- AppVersion={#AppVer}-qt4
- AppCopyright=© 2008-2017 Psi+ Project
- VersionInfoVersion={#AppVer}
- VersionInfoCompany=Psi+ Project
- VersionInfoTextVersion={VersionInfoVersion}-qt4
- VersionInfoCopyright=© 2008-2017 Psi+ Project
- VersionInfoProductName=Psi+
- VersionInfoProductVersion={#AppVer}
- VersionInfoProductTextVersion={#AppVer}
- AppId={{1C1C14F3-28EB-4A16-82BC-99977A774C2E}
- AppPublisher=Psi+ Project
- AppPublisherURL=http://psi-plus.com/
- LicenseFile=E:\Temp\psi-dev\dev\common\copying.txt
- SetupIconFile=E:\build\psibuild\work\win32\app.ico
- OutputDir=E:\Temp\psi-dev\dev
- OutputBaseFilename=psi-plus-{#AppVer}-qt4-setup
- Compression=lzma2/ultra64
- InternalCompressLevel=ultra
- AlwaysShowComponentsList=False
- DefaultDirName={pf}\Psi-plus-qt4
- UninstallDisplayName=Psi+ {#AppVer}-qt4
- AllowNoIcons=True
- DefaultGroupName=Psi+ (Qt4)
- AppSupportURL=https://github.com/psi-plus/main/issues
- AppUpdatesURL=http://yadi.sk/d/FD8HHORTQ5HYc
- UninstallDisplayIcon={app}\psi-plus.exe
- UninstallLogMode=new
- [Types]
- Name: "Psi+"; Description: "Install Psi+"
- Name: "Psi+WebKit"; Description: "Install Psi+ with WebKit support"
- [Files]
- Source: "E:\Temp\psi-dev\dev\common\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: common
- Source: "E:\Temp\psi-dev\dev\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: common
- Source: "E:\Temp\psi-dev\dev\lib32\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs32
- Source: "E:\Temp\psi-dev\dev\psimedia\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs32
- Source: "E:\Temp\psi-dev\dev\plugins32\*"; DestDir: "{app}\plugins"; Flags: ignoreversion createallsubdirs recursesubdirs confirmoverwrite; Components: plugins32
- Source: "E:\Temp\psi-dev\dev\bin32\psi-plus.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: bin32
- Source: "E:\Temp\psi-dev\dev\bin32-w\psi-plus.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: bin32w
- Source: "E:\Temp\psi-dev\dev\common\copying.txt"; DestDir: "{app}"; Flags: ignoreversion
- [Dirs]
- Name: "{app}\plugins"
- [Run]
- Filename: "{app}\psi-plus.exe"; WorkingDir: "{app}"; Flags: postinstall nowait skipifsilent
- [Icons]
- Name: "{userdesktop}\Psi+(Qt4)"; Filename: "{app}\psi-plus.exe"; WorkingDir: "{app}"; Flags: createonlyiffileexists; IconFilename: "{app}\psi-plus.exe"; IconIndex: 0; Tasks: desktopitems
- Name: "{group}\Uninstall Psi+(Qt4)"; Filename: "{uninstallexe}"; Flags: createonlyiffileexists; IconFilename: "{app}\psi-plus.exe"; IconIndex: 0; Tasks: uninstallitems
- Name: "{group}\Psi+(Qt4)"; Filename: "{app}\psi-plus.exe"; WorkingDir: "{app}"; Flags: createonlyiffileexists; IconFilename: "{app}\psi-plus.exe"
- [ThirdParty]
- UseRelativePaths=True
- [Tasks]
- Name: "desktopitems"; Description: "{cm:InstallDS}"; Components: common
- Name: "uninstallitems"; Description: "{cm:InstallUN}"; Components: common
- [CustomMessages]
- english.InstallDS=Create Psi+ desktop shortcut
- russian.InstallDS=Установить иконку Psi+ на Рабочий стол
- french.InstallDS=Créer un raccourci de bureau
- english.InstallUN=Create Uninstall icon in Program Group
- russian.InstallUN=Создать иконку Uninstall в меню программы
- french.InstallUN=Créer un raccourci de désinstallation dans le groupe du logiciel
- [Code]
- function GetNumber(var temp: String): Integer;
- var
- part: String;
- pos1: Integer;
- begin
- if Length(temp) = 0 then
- begin
- Result := -1;
- Exit;
- end;
- pos1 := Pos('.', temp);
- if (pos1 = 0) then
- begin
- Result := StrToInt(temp);
- temp := '';
- end
- else
- begin
- part := Copy(temp, 1, pos1 - 1);
- temp := Copy(temp, pos1 + 1, Length(temp));
- Result := StrToInt(part);
- end;
- end;
- function CompareInner(var temp1, temp2: String): Integer;
- var
- num1, num2: Integer;
- begin
- num1 := GetNumber(temp1);
- num2 := GetNumber(temp2);
- if (num1 = -1) or (num2 = -1) then
- begin
- Result := 0;
- Exit;
- end;
- if (num1 > num2) then
- begin
- Result := 1;
- end
- else if (num1 < num2) then
- begin
- Result := -1;
- end
- else
- begin
- Result := CompareInner(temp1, temp2);
- end;
- end;
- function CompareVersion(str1, str2: String): Integer;
- var
- temp1, temp2: String;
- begin
- temp1 := str1;
- temp2 := str2;
- Result := CompareInner(temp1, temp2);
- end;
- function InitializeSetup(): Boolean;
- var
- oldVersion: String;
- uninstaller: String;
- ErrorCode: Integer;
- vCurID :String;
- vCurAppName :String;
- begin
- vCurID:= '{#SetupSetting("AppId")}';
- vCurAppName:= '{#SetupSetting("AppName")}';
- //remove first "{" of ID
- vCurID:= Copy(vCurID, 2, Length(vCurID) - 1);
- //
- if RegKeyExists(HKEY_LOCAL_MACHINE,
- 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1') then
- begin
- RegQueryStringValue(HKEY_LOCAL_MACHINE,
- 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
- 'DisplayVersion', oldVersion);
- if (CompareVersion(oldVersion, '{#SetupSetting("AppVersion")}') < 0) then
- begin
- if MsgBox('Previous version - v' + oldVersion + ' of "' + vCurAppName + '" detected. ' + ' Setup will remove ' + oldVersion + ' version . Do you want to continue?',
- mbConfirmation, MB_YESNO) = IDNO then
- begin
- Result := False;
- end
- else
- begin
- RegQueryStringValue(HKEY_LOCAL_MACHINE,
- 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
- 'UninstallString', uninstaller);
- ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
- Result := True;
- end;
- end
- else
- begin
- MsgBox('The same version ' + oldVersion + ' of ' + vCurAppName + ' or newer is already installed. This installer will exit now.',
- mbInformation, MB_OK);
- Result := False;
- end;
- end
- else
- begin
- Result := True;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement