Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
166 lines (140 sloc) 6.88 KB
; 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.mute.fm"
#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.mute.fm/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;