Created
December 19, 2016 23:59
-
-
Save AlexKorsakov/36970b727e7d421f90bf5fb1f5f5bdc9 to your computer and use it in GitHub Desktop.
Installiation file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Скрипт создан при помощи мастера создания скриптов. | |
; СМ. ДОКУМЕНТАЦИЮ ДЛЯ ИЗУЧЕНИЯ ДЕТАЛЕЙ ОТНОСИТЕЛЬНО СОЗДАНИЯ ФАЙЛОВ СКРИПТА INNO SETUP! | |
[Setup] | |
AppName=PowerMgmntServer | |
AppVerName=PowerManagementServiceServer 1.0 | |
AppPublisher=Alex Korsakov | |
DefaultDirName={pf}\PowerMgmntServer | |
DefaultGroupName=PowerMgmntServer | |
OutputBaseFilename=setup | |
Compression=lzma | |
SolidCompression=yes | |
[Languages] | |
Name: "russian"; MessagesFile: "compiler:Default.isl" | |
Name: "english"; MessagesFile: "compiler:Languages\English.isl" | |
[Files] | |
Source: "C:\Users\MrShnicel\Documents\ServerService\bin\Release\ServerService.exe"; DestDir: "{app}"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\log_14.0.48.txt"; DestDir: "{userappdata}\PowerMgmntData"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\install_service.bat"; DestDir: "{app}"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\uninstall_service.bat"; DestDir: "{app}"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\help.html"; DestDir: "{app}\help"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\src\1.png"; DestDir: "{app}\help\src"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\src\2.png"; DestDir: "{app}\help\src"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\hallelujah.wav"; DestDir: "{app}"; Flags: ignoreversion | |
Source: "C:\Users\MrShnicel\Desktop\dotNetFx40_Full_setup.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall ignoreversion; Check: not IsRequiredDotNetDetected | |
; ОТМЕТЬТЕ: Не используйте "Флажки: Проигнорировать версию" на любых общедоступных системных файлах | |
[Registry] | |
Root: HKCU; Subkey: "Software\PowerMgmntServer"; ValueType: String; ValueName: InstallFolder; ValueData: "{app}"; Flags: uninsdeletekey | |
Root: HKCU; Subkey: "Software\PowerMgmntServer"; ValueType: String; ValueName: Version; ValueData: "1.0"; Flags: uninsdeletekey | |
[Code] | |
#include "dotnet.pas" | |
function IsRequiredDotNetDetected(): boolean; | |
begin | |
result := IsDotNetDetected('v4.0 Full Profile', 0); | |
end; | |
function sndPlaySound(lpszSoundName: String; uFlags: cardinal): Integer; external 'sndPlaySoundA@winmm stdcall delayload'; | |
function PlaySound(lpszSoundName: String; uFlags: cardinal): Integer; external 'sndPlaySoundA@winmm.dll stdcall'; | |
function NextButtonClick(CurPageID: Integer): Boolean; | |
begin | |
sndPlaySound(ExpandConstant('{tmp}\hallelujah.wav'),$0001); | |
Result := True; | |
end; | |
function BackButtonClick(CurPageID: Integer): Boolean; | |
begin | |
sndPlaySound(ExpandConstant('{tmp}\hallelujah.wav'),$0001); | |
Result := True; | |
end; | |
procedure InitializeWizard(); | |
begin | |
ExtractTemporaryFile('hallelujah.wav'); | |
end; | |
function InitializeSetup(): boolean; | |
begin | |
if not IsDotNetDetected('v4.0 Full Profile', 0) then | |
begin | |
MsgBox('{#Name} requires Microsoft .NET Framework 4.0 Full Profile.'#13#13 | |
'The installer will attempt to install it', mbInformation, MB_OK); | |
end; | |
result := true; | |
end; | |
[Icons] | |
Name: "{group}\Help\"; Filename: "{app}\help\" | |
Name: "{group}\PowerMgmnt"; Filename: "{uninstallexe}" | |
[Run] | |
Filename: {tmp}\dotNetFx40_Full_setup.exe; Parameters: "/q:a /c:""install /l /q"""; Check: not IsRequiredDotNetDetected; StatusMsg: Microsoft Framework 4.0 is installed. Please wait... | |
Filename: {app}\install_service.bat; Flags: nowait shellexec; | |
[UninstallRun] | |
Filename: {app}\uninstall_service.bat; Flags: nowait shellexec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment