-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
setup.iss
124 lines (101 loc) · 3.48 KB
/
setup.iss
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#define MyAppName "the ""Fuck off EA App"" patch by p0358"
;#define MyAppVersion "1" -- specified on the command line
#define MyAppPublisher "p0358"
#define MyAppURL "https://github.com/p0358/Fuck_off_EA_App"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{1A5F933F-77F5-496D-9738-D3DCC8917A9D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetInstallationPath}
DefaultGroupName=FuckOffEAApp
AllowNoIcons=yes
DisableProgramGroupPage=yes
;InfoBeforeFile=pre_install_info.txt
DisableWelcomePage=yes
;InfoAfterFile=post_install_info.txt
OutputBaseFilename=Fuck_off_EA_App_installer
OutputDir=.
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
DisableReadyPage=yes
ShowLanguageDialog=no
CreateUninstallRegKey=no
DirExistsWarning=no
EnableDirDoesntExistWarning=yes
CloseApplications=force
CloseApplicationsFilter=*.exe,*.dll,*.chm,*.bik,*.asi,*.log,*.json
Uninstallable=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "build\bin\Win32-Release\version.dll"; DestDir: "{app}"; Flags: ignoreversion
[Registry]
Root: HKLM32; Subkey: "SOFTWARE\Electronic Arts\EA Desktop"; ValueType: string; ValueName: "InstallSuccessful"; ValueData: "true"; Flags: createvalueifdoesntexist; Check: IsEAAppCheckBoxChecked
[Code]
function InitializeSetup: Boolean;
begin
Result := True;
end;
var
EAAppCheckBox: TNewCheckBox;
procedure InitializeWizard;
begin
EAAppCheckBox := TNewCheckBox.Create(WizardForm);
EAAppCheckBox.Parent := WizardForm.SelectDirPage;
EAAppCheckBox.Top := 120;
EAAppCheckBox.Left := 0;
EAAppCheckBox.Width := 500;
EAAppCheckBox.Caption := 'Pretend EA App is installed (so that Steam does not start its installer)';
end;
function IsEAAppCheckBoxChecked: Boolean;
begin
Result := EAAppCheckBox.Checked;
end;
procedure RegisterExtraCloseApplicationsResources;
begin
RegisterExtraCloseApplicationsResource(False, ExpandConstant('{app}\Origin.exe'));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
//else
// WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;
var
InstallationPath: string;
function GetInstallationPath(Param: string): string;
begin
{ Detected path is cached, as this gets called multiple times }
if InstallationPath = '' then
begin
if RegQueryStringValue(
HKLM32, 'SOFTWARE\Origin',
'OriginPath', InstallationPath) then
begin
StringChangeEx(InstallationPath, '\Origin.exe', '', True)
Log('Detected Origin installation: ' + InstallationPath);
end
else
begin
InstallationPath := 'C:\Program Files (x86)\Origin';
Log('No installation detected, using the default path: ' + InstallationPath);
end;
end;
Result := InstallationPath;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if not FileExists(ExpandConstant('{app}\Origin.exe')) then begin
Result := 'Origin is not installed!'#13#10#13#10'Please install Origin itself first before installing this patch (OriginSetup.exe).'#13#10#13#10'Read the project''s README on GitHub for more details.'
end;
end;