1
; Script generated by the Inno Setup Script Wizard.
2
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
9
OutputBaseFilename=Last.fm-0.0.0.0-jp
10
VersionInfoVersion=1.4.2
11
VersionInfoTextVersion=1.4.2
13
AppVerName=Last.fm {cm:Version}
14
VersionInfoDescription=Last.fm Installer
16
AppPublisherURL=http://www.last.fm
17
AppSupportURL=http://www.last.fm
18
AppUpdatesURL=http://www.last.fm
19
AppCopyright=Copyright 2007 Last.fm Ltd. (C)
20
DefaultDirName={pf}\Last.fm
22
DefaultGroupName=Last.fm
29
DisableFinishedPage=no
30
ShowLanguageDialog=yes
31
WizardImageFile=.\res\wizard.bmp
32
WizardSmallImageFile=.\res\app_55.bmp
33
SetupIconFile=.\res\install.ico
34
WizardImageBackColor=$ffffff
36
AppMutex=Lastfm-F396D8C8-9595-4f48-A319-48DCB827AD8F, Audioscrobbler-7BC5FBA0-A70A-406e-A50B-235D5AFE67FB
38
; This should stay the same across versions for the installer to treat it as the same program.
39
; It will then work to install however many updates and then run the uninstall script for
45
; The first string is an internal code that we can set to whatever we feel like
46
Name: "en"; MessagesFile: "compiler:Default.isl"
47
Name: "jp"; MessagesFile: ".\res\Japanese.isl"
51
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
53
; The OnlyBelowVersion flag disables this on Vista as an admin-run installer can't install a quick launch
54
; icon to the standard user's folder location. Sucks.
55
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0, 6;
59
; Needed to kill helper
60
Source: ".\bin\killer.exe"; DestDir: "{app}"; Flags: ignoreversion
63
Source: ".\bin\LastFM.exe"; DestDir: "{app}"; Flags: ignoreversion
64
Source: ".\bin\Updater.exe"; DestDir: "{app}"; Flags: ignoreversion
65
Source: ".\bin\CrashReporter.exe"; DestDir: "{app}"; Flags: ignoreversion
66
Source: ".\bin\LastFMHelper.exe"; DestDir: "{app}"; Flags: ignoreversion
67
Source: ".\bin\Cleaner.exe"; DestDir: "{app}"; Flags: ignoreversion
68
Source: ".\bin\LastFmTools1.dll"; DestDir: "{app}"; Flags: ignoreversion
69
Source: ".\bin\breakpad.dll"; DestDir: "{app}"; Flags: ignoreversion
71
; These $VARS are replaced by the build script
72
Source: "%QTDIR%\bin\QtCore4.dll"; DestDir: "{app}"; Flags: ignoreversion
73
Source: "%QTDIR%\bin\QtGui4.dll"; DestDir: "{app}"; Flags: ignoreversion
74
Source: "%QTDIR%\bin\QtNetwork4.dll"; DestDir: "{app}"; Flags: ignoreversion
75
Source: "%QTDIR%\bin\QtXml4.dll"; DestDir: "{app}"; Flags: ignoreversion
76
Source: "%QTDIR%\bin\QtSql4.dll"; DestDir: "{app}"; Flags: ignoreversion
77
Source: "%QTDIR%\plugins\imageformats\qjpeg1.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
78
Source: "%QTDIR%\plugins\imageformats\qgif1.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
79
Source: "%QTDIR%\plugins\imageformats\qmng1.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
80
Source: "%QTDIR%\plugins\sqldrivers\qsqlite.dll"; DestDir: "{app}\sqldrivers"; Flags: ignoreversion
81
Source: "%VSDIR%\SDK\v1.1\Bin\msvcp71.dll"; DestDir: "{app}"; Flags: ignoreversion
82
Source: "%VSDIR%\SDK\v1.1\Bin\msvcr71.dll"; DestDir: "{app}"; Flags: ignoreversion
84
Source: ".\bin\dbghelp.dll"; DestDir: "{app}"; Flags: ignoreversion
85
Source: ".\bin\shfolder.dll"; DestDir: "{app}"; Flags: ignoreversion
86
Source: ".\bin\zlibwapi.dll"; DestDir: "{app}"; Flags: ignoreversion
87
Source: ".\bin\VistaLib32.dll"; DestDir: "{app}"; Flags: ignoreversion
88
Source: ".\bin\VistaLib64.dll"; DestDir: "{app}"; Flags: ignoreversion
89
Source: ".\bin\srv_httpinput.dll"; DestDir: "{app}"; Flags: ignoreversion
90
Source: ".\bin\srv_rtaudioplayback.dll"; DestDir: "{app}"; Flags: ignoreversion
91
Source: ".\bin\srv_mp3transcode.dll"; DestDir: "{app}"; Flags: ignoreversion
92
; Should probably package this one with the iTunes plugin
93
Source: ".\bin\srv_itunesdevice.dll"; DestDir: "{app}"; Flags: ignoreversion
95
; This is the sickest shit. If I leave their real names, one of them won't load on Win98.
96
; If I call them ext_1,2,3 they all will.
98
Source: ".\bin\ext_skypenotify.dll"; DestDir: "{app}"; DestName: "ext_4.dll"; MinVersion: 1, 0; Flags: ignoreversion
101
Source: ".\bin\ext_skypenotify.dll"; DestDir: "{app}"; MinVersion: 0, 1; Flags: ignoreversion
103
Source: ".\ChangeLog.txt"; DestDir: "{app}"; Flags: ignoreversion
104
Source: ".\COPYING"; DestDir: "{app}"; Flags: ignoreversion
106
Source: ".\bin\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs
110
Root: HKLM; Subkey: "Software\Last.fm\Client"; ValueType: string; ValueName: "Version"; ValueData: "{cm:Version}"; Flags: uninsdeletekey
111
Root: HKLM; Subkey: "Software\Last.fm\Client"; ValueType: string; ValueName: "Path"; ValueData: "{app}\LastFM.exe"; Flags: uninsdeletekey
112
Root: HKLM; Subkey: "Software\Last.fm\Client"; ValueType: string; ValueName: "HelperPath"; ValueData: "{app}\LastFMHelper.exe"; Flags: uninsdeletekey
114
; Register last.fm protocol only if it isn't already
115
Root: HKCR; Subkey: "lastfm"; ValueType: string; ValueName: ""; ValueData: "URL:lastfm"; Flags: uninsdeletekey
116
Root: HKCR; Subkey: "lastfm"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletekey
117
Root: HKCR; Subkey: "lastfm\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\LastFM.exe"" ""%1"""; Flags: uninsdeletekey
118
Root: HKCR; Subkey: "lastfm"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletekey
120
; This is just for deleting keys at uninstall
121
Root: HKCU; Subkey: "Software\Last.fm"; Flags: dontcreatekey uninsdeletekeyifempty
122
Root: HKLM; Subkey: "Software\Last.fm"; Flags: dontcreatekey uninsdeletekeyifempty
123
Root: HKCU; Subkey: "Software\Last.fm\Client"; Flags: dontcreatekey uninsdeletekey
124
Root: HKLM; Subkey: "Software\Last.fm\Client"; Flags: dontcreatekey uninsdeletekey
128
Filename: "{app}\LastFM.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.last.fm"
132
Name: "{group}\Last.fm"; Filename: "{app}\LastFM.exe"
133
Name: "{group}\Go to www.last.fm"; Filename: "{app}\LastFM.url"
134
Name: "{group}\{cm:UninstallProgram,Last.fm}"; Filename: "{uninstallexe}"
135
Name: "{commondesktop}\Last.fm"; Filename: "{app}\LastFM.exe"; Tasks: desktopicon
136
Name: "{commonstartup}\Last.fm Helper"; Filename: "{app}\LastFMHelper.exe"
138
; The OnlyBelowVersion flag disables this on Vista as an admin-run installer can't install a quick launch
139
; icon to the standard user's folder location. Sucks.
140
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Last.fm"; Filename: "{app}\LastFM.exe"; OnlyBelowVersion: 0,6; Tasks: quicklaunchicon
144
; Launch normally for pre-Vista versions
145
Filename: "{app}\LastFMHelper.exe"; Flags: nowait runhidden; OnlyBelowVersion: 0,6
146
Filename: "{app}\LastFM.exe"; Description: "{cm:LaunchProgram,Last.fm}"; Flags: nowait postinstall; OnlyBelowVersion: 0,6
148
; For Vista, we have to go through the VistaLib to get the apps to launch non-elevated.
149
; Not launching helper here (app does it on startup) as it led to two instances being launched
150
; through the VistaLib DLL.
151
Filename: "RunDll32.exe"; Parameters: "{code:GetPathVistaDll},RunNonElevated {code:AddQuotes|{app}\LastFM.exe}"; Description: "{cm:LaunchProgram,Last.fm}"; Flags: nowait postinstall; MinVersion: 0,6
155
; So that these files get replaced on Win98 with their renamed versions (see above)
156
Type: files; Name: "{app}ext_metadata.dll";
157
Type: files; Name: "{app}ext_search.dll";
158
Type: files; Name: "{app}ext_sidebar.dll";
159
Type: files; Name: "{app}ext_notifyskype.dll";
161
; Old shortcut that lived in user desktop
162
Type: files; Name: "{userdesktop}\Last.fm.lnk"
165
; This is the LAST step of uninstallation
168
Type: files; Name: "{app}\LastFM.url"
169
Type: files; Name: "{app}\UpTemp.exe"
170
Type: dirifempty; Name: "{app}"
172
Type: filesandordirs; Name: "{localappdata}\Last.fm\Client"; OnlyBelowVersion: 0,6
173
Type: dirifempty; Name: "{localappdata}\Last.fm"; OnlyBelowVersion: 0,6
175
; This should be possible to delete as we're waiting until all the plugin uninstallers have been run.
176
Type: files; Name: "{commonappdata}\Last.fm\Client\uninst.bat"
177
Type: files; Name: "{commonappdata}\Last.fm\Client\uninst2.bat"
178
Type: filesandordirs; Name: "{commonappdata}\Last.fm\Client"
179
Type: dirifempty; Name: "{commonappdata}\Last.fm"
182
; This is the FIRST step of uninstallation
184
; Vista only: We need to do this to clean out any HKCU and {localappdata} locations for a potential standard user who used the application.
185
; But we can't! Because there is currently no way of making the installer wait for the Cleaner to finish which means we'll end up with
187
;Filename: "RunDll32.exe"; Parameters: "{code:GetPathVistaDll},RunNonElevated {code:AddQuotes|{app}\Cleaner.exe}"; Flags: waituntilterminated runhidden; MinVersion: 0,6
192
var g_firstRun: Boolean;
194
procedure QuitHelper(install: Boolean);
198
processExitCode: Integer;
203
if (RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Last.fm\Client', 'HelperPath', helperPath)) then
205
execOK := ShellExec('open', helperPath, '--quit', '', SW_HIDE, ewWaitUntilTerminated, processExitCode);
206
//if (execOK = False) then MsgBox(SysErrorMessage(processExitCode), mbInformation, MB_OK);
209
// For some unknown reason, the helper sometimes fails to shut down. So we try
210
// a brute force shutdown via process.exe too. This can also happen if the helper
211
// path was written by an old installer which put it in a user's HKCU.
214
//MsgBox('install, extract temporary', mbInformation, MB_OK);
215
ExtractTemporaryFile('killer.exe');
216
killerPath := ExpandConstant('{tmp}\killer.exe');
220
//MsgBox('uninstall, use killer from app', mbInformation, MB_OK);
221
killerPath := ExpandConstant('{app}\killer.exe');
224
execOK := Exec(killerPath, 'LastFMHelper.exe', '', SW_HIDE, ewWaitUntilTerminated, processExitCode);
225
if (execOK = False) then MsgBox('Failed to shut down helper process', mbError, MB_OK);
229
// This must be called before the install and its value stored
230
function IsUpgrade(): Boolean;
235
if not RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\LastFM_is1', 'UninstallString', sPrevpath) then
236
RegQueryStringValue(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\LastFM_is1', 'UninstallString', sPrevpath);
237
Result := (sPrevPath <> '');
240
function InitializeSetup(): Boolean;
244
// Need to evaluate and store this before any installation has been done
245
g_firstRun := not IsUpgrade();
251
function ShouldSkipPage(PageID: Integer): Boolean;
256
// We skip the final screen if it's first run and go straight into config wizard
265
function GetPathVistaDll(Param: String): String;
270
path := AddQuotes( ExpandConstant('{app}') + '\VistaLib64.dll' )
272
path := AddQuotes( ExpandConstant('{app}') + '\VistaLib32.dll' );
274
//MsgBox('path: ' + path, mbInformation, MB_OK);
280
//procedure RunNonElevated32( hWnd: Integer; file, params, dir: String );
281
//external 'RunNonElevated@files:VistaLib32.dll';
284
//procedure RunNonElevated64( hWnd: Integer; file, params, dir: String );
285
//external 'RunNonElevated@files:VistaLib64.dll';
288
procedure CurUninstallStepChanged(CurStep: TUninstallStep);
291
uninstallers: TArrayOfString;
295
processExitCode: Integer;
298
if (CurStep = usUninstall) then
303
// Uninstall the plugins
304
batfile := ExpandConstant('{commonappdata}\Last.fm\Client\uninst2.bat');
305
LoadStringsFromFile(batfile, uninstallers);
306
//MsgBox('loaded string array', mbInformation, MB_OK);
308
arrayLen := GetArrayLength(uninstallers) - 1;
309
for lineIdx := 0 to arrayLen do
311
currentLine := uninstallers[lineIdx];
313
if (Pos('start', currentLine) = 1) then
315
// Old style entry, convert from OEM codepage and strip junk
316
OemToCharBuff(currentLine);
317
Delete(currentLine, 1, 16);
319
//MsgBox('deleted front: ' + currentLine, mbInformation, MB_OK);
321
Delete(currentLine, Pos('"', currentLine), Length(currentLine) - Pos('"', currentLine) + 1 );
323
//MsgBox('deleted back: ' + currentLine, mbInformation, MB_OK);
325
//MsgBox('old style, trying: ' + currentLine, mbInformation, MB_OK);
327
execOK := Exec(currentLine, '/SILENT', '', SW_SHOW, ewWaitUntilTerminated, processExitCode);
328
//if (execOK = True) then MsgBox('OEM exec successful', mbInformation, MB_OK)
329
//else MsgBox('OEM exec failed', mbInformation, MB_OK);
332
//MsgBox('execing line: ' + currentLine, mbInformation, MB_OK);
333
execOK := Exec(currentLine, '/SILENT', '', SW_SHOW, ewWaitUntilTerminated, processExitCode);
334
//if (execOK = True) then MsgBox('exec successful', mbInformation, MB_OK)
335
//else MsgBox('exec failed', mbInformation, MB_OK);
341
//Exec( 'RunDll32.exe', GetPathVistaDll('') + ',RunNonElevated ' + AddQuotes( ExpandConstant( '{app}' ) + '\Cleaner.exe' ), '', SW_HIDE, ewWaitUntilTerminated, processExitCode );
343
// Horrible, but there's no way of ensuring that the script waits for the Cleaner to finish.
344
// This is still not enough. Big caches take some time to wipe.
347
end; // end of CurStep = usUninstall