~ubuntu-branches/ubuntu/lucid/lastfm/lucid

« back to all changes in this revision

Viewing changes to build-installer-win-jp.iss

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2007-12-31 09:49:54 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071231094954-ix1amvcsj9pk61ya
Tags: 1:1.4.1.57486.dfsg-1ubuntu1
* Merge from Debian unstable (LP: #180254), remaining changes:
  - debian/rules;
    - Added dh_icons
  - Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
; Script generated by the Inno Setup Script Wizard.
2
 
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3
 
 
4
 
[CustomMessages]
5
 
Version=0.0.0.0
6
 
 
7
 
 
8
 
[Setup]
9
 
OutputBaseFilename=Last.fm-0.0.0.0-jp
10
 
VersionInfoVersion=1.4.2
11
 
VersionInfoTextVersion=1.4.2
12
 
AppName=Last.fm
13
 
AppVerName=Last.fm {cm:Version}
14
 
VersionInfoDescription=Last.fm Installer
15
 
AppPublisher=Last.fm
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
21
 
UsePreviousAppDir=yes
22
 
DefaultGroupName=Last.fm
23
 
OutputDir=dist
24
 
AllowNoIcons=yes
25
 
Compression=lzma
26
 
SolidCompression=yes
27
 
DisableReadyPage=yes
28
 
DirExistsWarning=no
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
35
 
WizardImageStretch=no
36
 
AppMutex=Lastfm-F396D8C8-9595-4f48-A319-48DCB827AD8F, Audioscrobbler-7BC5FBA0-A70A-406e-A50B-235D5AFE67FB
37
 
 
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
40
 
; the first version.
41
 
AppId=LastFM
42
 
 
43
 
 
44
 
[Languages]
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"
48
 
 
49
 
 
50
 
[Tasks]
51
 
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
52
 
 
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;
56
 
 
57
 
 
58
 
[Files]
59
 
; Needed to kill helper
60
 
Source: ".\bin\killer.exe"; DestDir: "{app}"; Flags: ignoreversion
61
 
 
62
 
; Main files
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
70
 
 
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
83
 
 
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
94
 
 
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.
97
 
; For Win9x
98
 
Source: ".\bin\ext_skypenotify.dll"; DestDir: "{app}"; DestName: "ext_4.dll"; MinVersion: 1, 0; Flags: ignoreversion
99
 
 
100
 
; For Win2k/XP
101
 
Source: ".\bin\ext_skypenotify.dll"; DestDir: "{app}"; MinVersion: 0, 1; Flags: ignoreversion
102
 
 
103
 
Source: ".\ChangeLog.txt"; DestDir: "{app}"; Flags: ignoreversion
104
 
Source: ".\COPYING"; DestDir: "{app}"; Flags: ignoreversion
105
 
 
106
 
Source: ".\bin\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs
107
 
 
108
 
 
109
 
[Registry]
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
113
 
 
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
119
 
 
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
125
 
 
126
 
 
127
 
[INI]
128
 
Filename: "{app}\LastFM.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.last.fm"
129
 
 
130
 
 
131
 
[Icons]
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"
137
 
 
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
141
 
 
142
 
 
143
 
[Run]
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
147
 
 
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
152
 
 
153
 
 
154
 
[InstallDelete]
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";
160
 
 
161
 
; Old shortcut that lived in user desktop
162
 
Type: files; Name: "{userdesktop}\Last.fm.lnk"
163
 
 
164
 
 
165
 
; This is the LAST step of uninstallation
166
 
[UninstallDelete]
167
 
; Legacy
168
 
Type: files; Name: "{app}\LastFM.url"
169
 
Type: files; Name: "{app}\UpTemp.exe"
170
 
Type: dirifempty; Name: "{app}"
171
 
 
172
 
Type: filesandordirs; Name: "{localappdata}\Last.fm\Client"; OnlyBelowVersion: 0,6
173
 
Type: dirifempty; Name: "{localappdata}\Last.fm"; OnlyBelowVersion: 0,6
174
 
 
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"
180
 
 
181
 
 
182
 
; This is the FIRST step of uninstallation
183
 
[UninstallRun]
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
186
 
; broken uninstalls.
187
 
;Filename: "RunDll32.exe"; Parameters: "{code:GetPathVistaDll},RunNonElevated {code:AddQuotes|{app}\Cleaner.exe}"; Flags: waituntilterminated runhidden; MinVersion: 0,6
188
 
 
189
 
 
190
 
[Code]
191
 
// Global variables
192
 
var g_firstRun: Boolean;
193
 
 
194
 
procedure QuitHelper(install: Boolean);
195
 
var
196
 
  helperPath: String;
197
 
  killerPath: String;
198
 
  processExitCode: Integer;
199
 
  execOK: Boolean;
200
 
begin
201
 
 
202
 
  // Quit the helper
203
 
  if (RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Last.fm\Client', 'HelperPath', helperPath)) then
204
 
  begin
205
 
    execOK := ShellExec('open', helperPath, '--quit', '', SW_HIDE, ewWaitUntilTerminated, processExitCode);
206
 
    //if (execOK = False) then MsgBox(SysErrorMessage(processExitCode), mbInformation, MB_OK);
207
 
  end;
208
 
 
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.
212
 
  if install then
213
 
  begin
214
 
    //MsgBox('install, extract temporary', mbInformation, MB_OK);
215
 
    ExtractTemporaryFile('killer.exe');
216
 
    killerPath := ExpandConstant('{tmp}\killer.exe');
217
 
  end
218
 
  else
219
 
  begin
220
 
    //MsgBox('uninstall, use killer from app', mbInformation, MB_OK);
221
 
    killerPath := ExpandConstant('{app}\killer.exe');
222
 
  end;
223
 
 
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);
226
 
 
227
 
end;
228
 
 
229
 
// This must be called before the install and its value stored
230
 
function IsUpgrade(): Boolean;
231
 
var
232
 
  sPrevPath: String;
233
 
begin
234
 
  sPrevPath := '';
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 <> '');
238
 
end;
239
 
 
240
 
function InitializeSetup(): Boolean;
241
 
begin
242
 
  QuitHelper(True);
243
 
 
244
 
  // Need to evaluate and store this before any installation has been done
245
 
  g_firstRun := not IsUpgrade();
246
 
 
247
 
  // Run setup
248
 
  Result := TRUE;
249
 
end;
250
 
 
251
 
function ShouldSkipPage(PageID: Integer): Boolean;
252
 
begin
253
 
  if PageID = 14 then
254
 
  begin
255
 
 
256
 
    // We skip the final screen if it's first run and go straight into config wizard
257
 
    if g_firstRun then
258
 
      Result := TRUE
259
 
    else
260
 
      Result := FALSE;
261
 
 
262
 
  end;
263
 
end;
264
 
 
265
 
function GetPathVistaDll(Param: String): String;
266
 
var
267
 
  path: String;
268
 
begin
269
 
  if IsWin64() then
270
 
    path := AddQuotes( ExpandConstant('{app}') +  '\VistaLib64.dll' )
271
 
  else
272
 
    path := AddQuotes( ExpandConstant('{app}') +  '\VistaLib32.dll' );
273
 
 
274
 
  //MsgBox('path: ' + path, mbInformation, MB_OK);
275
 
  Result := path;
276
 
end;
277
 
 
278
 
 
279
 
// These don't work
280
 
//procedure RunNonElevated32( hWnd: Integer; file, params, dir: String );
281
 
//external 'RunNonElevated@files:VistaLib32.dll';
282
 
 
283
 
 
284
 
//procedure RunNonElevated64( hWnd: Integer; file, params, dir: String );
285
 
//external 'RunNonElevated@files:VistaLib64.dll';
286
 
 
287
 
 
288
 
procedure CurUninstallStepChanged(CurStep: TUninstallStep);
289
 
var
290
 
  batfile: String;
291
 
  uninstallers: TArrayOfString;
292
 
  arrayLen: Integer;
293
 
  lineIdx: Integer;
294
 
  currentLine: String;
295
 
  processExitCode: Integer;
296
 
  execOK: Boolean;
297
 
begin
298
 
  if (CurStep = usUninstall) then
299
 
  begin
300
 
 
301
 
    QuitHelper(False);
302
 
 
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);
307
 
 
308
 
    arrayLen := GetArrayLength(uninstallers) - 1;
309
 
    for lineIdx := 0 to arrayLen do
310
 
    begin
311
 
      currentLine := uninstallers[lineIdx];
312
 
 
313
 
      if (Pos('start', currentLine) = 1) then
314
 
      begin
315
 
        // Old style entry, convert from OEM codepage and strip junk
316
 
        OemToCharBuff(currentLine);
317
 
        Delete(currentLine, 1, 16);
318
 
 
319
 
        //MsgBox('deleted front: ' + currentLine, mbInformation, MB_OK);
320
 
 
321
 
        Delete(currentLine, Pos('"', currentLine), Length(currentLine) - Pos('"', currentLine) + 1 );
322
 
 
323
 
        //MsgBox('deleted back: ' + currentLine, mbInformation, MB_OK);
324
 
 
325
 
        //MsgBox('old style, trying: ' + currentLine, mbInformation, MB_OK);
326
 
 
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);
330
 
      end else
331
 
      begin
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);
336
 
      end;
337
 
 
338
 
    end; // end of loop
339
 
 
340
 
    // Run Cleaner
341
 
    //Exec( 'RunDll32.exe', GetPathVistaDll('') + ',RunNonElevated ' + AddQuotes( ExpandConstant( '{app}' ) + '\Cleaner.exe' ), '', SW_HIDE, ewWaitUntilTerminated, processExitCode );
342
 
 
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.
345
 
    //Sleep( 5000 );
346
 
 
347
 
  end; // end of CurStep = usUninstall
348
 
 
349
 
end;