Przeglądaj źródła

Make uninstaller use vista.pas

Wording changes


git-svn-id: http://svn.dmdirc.com/trunk@4180 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 lat temu
rodzic
commit
727b7c7a91

+ 61
- 6
installer/windows/Uninstaller.dpr Wyświetl plik

@@ -1,11 +1,66 @@
1 1
 program Uninstaller;
2
-{$MODE Delphi}
3
-{$APPTYPE GUI}
2
+{$IFDEF FPC}
3
+	{$MODE Delphi}
4
+{$ENDIF}
5
+// Use this instead of {$APPTYPE XXX}
6
+// APP_XXX is the same as {$APPTYPE XXX}
7
+// Defaults to console
8
+// This is a work-around for a bug in FPC Cross Compiling to windows in delphi
9
+// mode (IsConsole is always true)
10
+{$DEFINE APP_GUI}
4 11
 
5
-uses Windows, SysUtils, classes, registry, Vista;
12
+// This block actually does the work for the above work-around
13
+{$IFDEF APP_GUI}
14
+	{$APPTYPE GUI}
15
+{$ELSE}
16
+	{$IFDEF APP_FS}
17
+		{$APPTYPE FS}
18
+	{$ELSE}
19
+		{$IFDEF APP_TOOL}
20
+			{$DEFINE APP_CONSOLE}
21
+			{$APPTYPE TOOL}
22
+		{$ELSE}
23
+			{$DEFINE APP_CONSOLE}
24
+			{$APPTYPE CONSOLE}
25
+		{$ENDIF}
26
+	{$ENDIF}
27
+{$ENDIF}
28
+
29
+uses Windows, SysUtils, registry, Vista;
6 30
 
7 31
 {$R uninstall.res}
8 32
 
33
+procedure dowriteln(line: String);
34
+begin
35
+	if IsConsole then writeln(line);
36
+end;
37
+
38
+procedure dowrite(line: String);
39
+begin
40
+	if IsConsole then write(line);
41
+end;
42
+
43
+function askQuestion(Question: String): boolean;
44
+begin
45
+	Result := TaskDialog(0, 'DMDirc Uninstaller', 'Question', Question, TD_ICON_QUESTION, TD_BUTTON_YES + TD_BUTTON_NO) = mrYes;
46
+end;
47
+
48
+procedure showError(context: String; ErrorMessage: String; addFooter: boolean = true);
49
+begin
50
+	if addFooter then begin
51
+		ErrorMessage := ErrorMessage+#13#10;
52
+		ErrorMessage := ErrorMessage+#13#10+'If you feel this is incorrect, or you require some further assistance,';
53
+		ErrorMessage := ErrorMessage+#13#10+'please feel free to contact us.';
54
+	end;
55
+	
56
+	TaskDialog(0, 'DMDirc Setup', context, ErrorMessage, TD_ICON_ERROR, TD_BUTTON_OK, true);
57
+end;
58
+
59
+procedure showmessage(message: String; context:String = 'Information');
60
+begin
61
+	TaskDialog(0, 'DMDirc Uninstaller', context, message, TD_ICON_INFORMATION, TD_BUTTON_OK);
62
+end;
63
+
9 64
 function GetTempDirectory(): String;
10 65
 var
11 66
 	buf: array[0..MAX_PATH] of Char;
@@ -150,15 +205,15 @@ begin
150 205
 			end;
151 206
 		end;
152 207
 		
153
-		MessageBox(0, PChar('DMDirc has been uninstalled from "'+InstallDir+'".'), 'DMDirc Uninstaller', MB_OK);
208
+		showmessage('DMDirc has been uninstalled from "'+InstallDir+'".', 'Uninstall Successful');
154 209
 	end
155
-	else if MessageBox(0, PChar('This will uninstall DMDirc.'+#13#10+#13#10+'Do you want to continue?'), 'DMDirc Uninstaller', MB_YESNO) = IDYES then begin
210
+	else if askQuestion('This will uninstall DMDirc.'+#13#10+#13#10+'Do you want to continue?') then begin
156 211
 		if (ExecAndWait('java -jar ' + ExtractFileDir(paramstr(0)) + '\DMDirc.jar -k', true) <> 0) then begin
157 212
 			TempDir := GetTempDirectory;
158 213
 			CopyFile(pchar(paramstr(0)), pchar(TempDir+'/uninstall.exe'), false);
159 214
 			Launch(TempDir+'/uninstall.exe '+ExtractFileDir(paramstr(0))+'\');
160 215
 		end else begin
161
-			MessageBox(0, PChar('Uninstall Aborted - DMDirc is still running.'+#13#10+'Please close DMDirc before continuing'), 'DMDirc Uninstaller', MB_OK + MB_ICONEXCLAMATION);
216
+			showError('Uninstall Aborted - DMDirc is still running.', 'Please close DMDirc before continuing')
162 217
 		end;
163 218
 	end;
164 219
 end.

+ 2
- 1
installer/windows/makeInstallerWindows.sh Wyświetl plik

@@ -391,6 +391,7 @@ if [ ! -e "${lazarusDir}/lcl" ]; then
391 391
 fi;
392 392
 
393 393
 compilerFlags="-Sd -Twin32 ${compilerFlags}";
394
+extraFlags=""
394 395
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then
395 396
 	echo "Setup.exe does not exist. Lets try and compile it."
396 397
 	if [ "${FPC}" = "" ]; then
@@ -475,7 +476,7 @@ fi
475 476
 ${FPC} ${compilerFlags} ${3}Uninstaller.dpr
476 477
 if [ -e "Uninstaller.exe" ]; then
477 478
 	FILES="${FILES} Uninstaller.exe"
478
-	DELETEFILES="${DELETEFILES} Uninstaller.exe"
479
+#	DELETEFILES="${DELETEFILES} Uninstaller.exe"
479 480
 fi
480 481
 
481 482
 # Add wget to allow downloading jre

+ 5
- 5
launcher/windows/DMDirc.dpr Wyświetl plik

@@ -10,7 +10,7 @@ uses Windows, SysUtils, classes, StrUtils, Vista;
10 10
 
11 11
 function askQuestion(Question: String): boolean;
12 12
 begin
13
-	Result := TaskDialog(0, 'DMDirc Setup', 'Question', Question, TD_ICON_QUESTION, TD_BUTTON_YES + TD_BUTTON_NO) = mrYes;
13
+	Result := TaskDialog(0, 'DMDirc', 'Question', Question, TD_ICON_QUESTION, TD_BUTTON_YES + TD_BUTTON_NO) = mrYes;
14 14
 end;
15 15
 
16 16
 procedure showError(ErrorMessage: String; addFooter: boolean = true);
@@ -21,12 +21,12 @@ begin
21 21
 		ErrorMessage := ErrorMessage+#13#10+'please feel free to contact us.';
22 22
 	end;
23 23
 	
24
-	TaskDialog(0, 'DMDirc Setup', 'Sorry, setup is unable to continue', ErrorMessage, TD_ICON_ERROR, TD_BUTTON_OK, true);
24
+	TaskDialog(0, 'DMDirc', 'There was an error starting DMDirc', ErrorMessage, TD_ICON_ERROR, TD_BUTTON_OK, false, false);
25 25
 end;
26 26
 
27 27
 procedure showmessage(message: String; context:String = 'Information');
28 28
 begin
29
-	TaskDialog(0, 'DMDirc Setup', context, message, TD_ICON_INFORMATION, TD_BUTTON_OK);
29
+	TaskDialog(0, 'DMDirc', context, message, TD_ICON_INFORMATION, TD_BUTTON_OK);
30 30
 end;
31 31
 
32 32
 
@@ -132,7 +132,7 @@ begin
132 132
 			errorMessage := 'No JVM is currently installed.';
133 133
 			errorMessage := errorMessage+#13#10;
134 134
 			errorMessage := errorMessage+#13#10+'DMDirc requires a 1.6.0 compatible JVM, you can get one from:';
135
-			errorMessage := errorMessage+#13#10+'http://jdl.sun.com/webapps/getjava/BrowserRedirect';
135
+			errorMessage := errorMessage+#13#10+'http://java.com/';
136 136
 			errorMessage := errorMessage+#13#10;
137 137
 			errorMessage := errorMessage+#13#10+'If you feel this is incorrect, or you require some further assistance,';
138 138
 			errorMessage := errorMessage+#13#10+'please feel free to contact us.';
@@ -147,7 +147,7 @@ begin
147 147
 				errorMessage := 'The currently installed version of java is not compatible with DMDirc.';
148 148
 				errorMessage := errorMessage+#13#10;
149 149
 				errorMessage := errorMessage+#13#10+'DMDirc requires a 1.6.0 compatible JVM, you can get one from:';
150
-				errorMessage := errorMessage+#13#10+'http://jdl.sun.com/webapps/getjava/BrowserRedirect';
150
+				errorMessage := errorMessage+#13#10+'http://java.com/';
151 151
 				errorMessage := errorMessage+#13#10;
152 152
 				errorMessage := errorMessage+#13#10+'If you feel this is incorrect, or you require some further assistance,';
153 153
 				errorMessage := errorMessage+#13#10+'please feel free to contact us.';

BIN
launcher/windows/DMDirc.exe Wyświetl plik


+ 3
- 3
launcher/windows/DMDircUpdater.dpr Wyświetl plik

@@ -8,7 +8,7 @@ uses Windows, SysUtils, classes, StrUtils, Vista;
8 8
 
9 9
 function askQuestion(Question: String): boolean;
10 10
 begin
11
-	Result := TaskDialog(0, 'DMDirc Setup', 'Question', Question, TD_ICON_QUESTION, TD_BUTTON_YES + TD_BUTTON_NO) = mrYes;
11
+	Result := TaskDialog(0, 'DMDirc Updater', 'Question', Question, TD_ICON_QUESTION, TD_BUTTON_YES + TD_BUTTON_NO) = mrYes;
12 12
 end;
13 13
 
14 14
 procedure showError(ErrorMessage: String; addFooter: boolean = true);
@@ -19,12 +19,12 @@ begin
19 19
 		ErrorMessage := ErrorMessage+#13#10+'please feel free to contact us.';
20 20
 	end;
21 21
 	
22
-	TaskDialog(0, 'DMDirc Setup', 'Sorry, setup is unable to continue', ErrorMessage, TD_ICON_ERROR, TD_BUTTON_OK, true);
22
+	TaskDialog(0, 'DMDirc Updater', 'There was an error starting DMDirc', ErrorMessage, TD_ICON_ERROR, TD_BUTTON_OK, false, false);
23 23
 end;
24 24
 
25 25
 procedure showmessage(message: String; context:String = 'Information');
26 26
 begin
27
-	TaskDialog(0, 'DMDirc Setup', context, message, TD_ICON_INFORMATION, TD_BUTTON_OK);
27
+	TaskDialog(0, 'DMDirc Updater', context, message, TD_ICON_INFORMATION, TD_BUTTON_OK);
28 28
 end;
29 29
 
30 30
 // Run an application and don't wait for it to finish.

BIN
launcher/windows/DMDircUpdater.exe Wyświetl plik


Ładowanie…
Anuluj
Zapisz