forked from jaredsohn/mutefm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mutefm_setup.iss
165 lines (140 loc) · 6.88 KB
/
mutefm_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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
; Script generated by the Inno Setup Script Wizard.
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
;(X)Update registry to have it run on startup, (X) verify that .net is installed, (X) ensure that user is at least running win7
;Note: Don't worry about setting up extension, browser settings, hiding sndvol, etc. since program itself will do it
; for showing in system tray by default, research this: http://social.msdn.microsoft.com/Forums/en/windowscompatibility/thread/fee62eb0-4f68-408c-aec2-82ffdf2ddd69
#define MyAppName "mute.fm"
#define MyAppVersion "0.9.5"
#define MyAppMutex "Global\{{4A850CD5-D080-481F-8DCC-923D214381C4}"
#define MyAppPublisher "mute.fm"
#define MyAppURL "http://www.mutefm.com"
#define MyAppExeName "mute_fm.exe"
[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={{4A850CD5-D080-481F-8DCC-923D214381C4}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppMutex={#MyAppMutex}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=mutefm_setup
SetupIconFile=..\src\favicon.ico
Compression=lzma
SolidCompression=yes
MinVersion=0,6.1
;ArchitecturesInstallIn64BitMode=x64 ia64
DefaultGroupName=mute.fm
RestartIfNeededByRun=false
; For updating registry to run on startup
PrivilegesRequired=admin
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Registry]
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "mute.fm"; ValueData: "{app}\{#MyAppExeName}"; Flags: uninsdeletevalue
[Files]
Source: "..\src\win\bin\Release\*.*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\src\favicon.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "flashinstaller.exe"; DestDir: "{%TEMP}"; Flags: ignoreversion
Source: "..\src\mixer\*.html"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.js"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.json"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.png"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.gif"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.css"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\*.ico"; DestDir: "{app}\mixer"; Flags: ignoreversion
Source: "..\src\mixer\css\*.*"; DestDir: "{app}\mixer\css"; Flags: ignoreversion
Source: "..\src\mixer\formwiz\*.*"; DestDir: "{app}\mixer\formwiz"; Flags: ignoreversion
;Source: "Growl_v2.0final.msi"; DestDir: "{%TEMP}"; Flags: ignoreversion
Source: "GrowlInstaller.exe"; DestDir: "{%TEMP}"; Flags: ignoreversion
Source: "..\growl_connector_license.txt"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Run]
Filename: "{%TEMP}\flashinstaller.exe"; Parameters: ""; Description: "Install Flash"; Flags: waituntilterminated
Filename: "{%TEMP}\GrowlInstaller.exe"; Parameters: ""; Description: "Install Growl"; Flags: waituntilterminated
Filename: "{app}\{#MyAppExeName}"; Description: "Run now"; Flags: nowait; Parameters: "FIRSTTIME"
;Filename: "http://www.mutefm.com/gettingstarted.html"; Flags: shellexec runasoriginaluser
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[UninstallDelete]
Type: filesandordirs; Name: "{userappdata}\mute.fm\Awesomium"
[Code]
const
WM_CLOSE = 16;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
begin
result := 'Installation notes:' + newline + newline + 'As this installer finishes, it will run the Flash installer. It is needed';
result := result + newline + 'because mute.fm uses its own Chromium-based browser to play ' + newline;
result := result + 'web-based music.' + newline + newline;
result := result + 'If you get a message saying that a newer version is already' + newline;
result := result + 'installed, please disregard it.' + newline + newline;
result := result + 'The installer also installs Growl for notifications. If you uninstall,' + newline;
result := result + 'you may want to uninstall that separately.';
end;
// From: http://stackoverflow.com/questions/4104011/innosetup-how-to-check-the-framework-4-0
function IsDotNetDetected(version: string; service: cardinal): boolean;
// Indicates whether the specified version and service pack of the .NET Framework is installed.
//
// version -- Specify one of these strings for the required .NET Framework version:
// 'v1.1.4322' .NET Framework 1.1
// 'v2.0.50727' .NET Framework 2.0
// 'v3.0' .NET Framework 3.0
// 'v3.5' .NET Framework 3.5
// 'v4\Client' .NET Framework 4.0 Client Profile
// 'v4\Full' .NET Framework 4.0 Full Installation
//
// service -- Specify any non-negative integer for the required service pack level:
// 0 No service packs required
// 1, 2, etc. Service pack 1, 2, etc. required
var
key: string;
install, serviceCount: cardinal;
success: boolean;
begin
key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + version;
// .NET 3.0 uses value InstallSuccess in subkey Setup
if Pos('v3.0', version) = 1 then begin
success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
end else begin
success := RegQueryDWordValue(HKLM, key, 'Install', install);
end;
// .NET 4.0 uses value Servicing instead of SP
if Pos('v4', version) = 1 then begin
success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
end else begin
success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
end;
result := success and (install = 1) and (serviceCount >= service);
end;
function KillProcessByName(processName : string) : boolean;
var
winHwnd : longint;
begin
winHwnd := FindWindowByWindowName(processName);
MsgBox('winHwnd: ' + inttostr(winHwnd), mbInformation, MB_OK );
if winHwnd <> 0 then
result:=postmessage(winHwnd,WM_CLOSE,0,0);
end;
function InitializeSetup(): Boolean;
begin
//KillProcessByName('WinSoundServer.exe'); //{#MyAppExeName}
if not IsDotNetDetected('v4\Client', 0) then begin
MsgBox('This program requires Microsoft .NET Framework 4.0 Full.'#13#13
'Please use Windows Update or download it from Microsoft to install this version,'#13
'and then re-run the setup program.', mbInformation, MB_OK);
result := false;
end else
result := true;
end;
function InitializeUninstall() : Boolean;
begin
//KillProcessByName('{#MyAppExeName}');
result := true;
end;