Browse Source

Use vista.pas for vista detection


git-svn-id: http://svn.dmdirc.com/trunk@4176 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
3cf53197c3

+ 2
- 4
installer/windows/Uninstaller.dpr View File

@@ -2,7 +2,7 @@ program Uninstaller;
2 2
 {$MODE Delphi}
3 3
 {$APPTYPE GUI}
4 4
 
5
-uses Windows, SysUtils, classes, registry;
5
+uses Windows, SysUtils, classes, registry, Vista;
6 6
 
7 7
 {$R uninstall.res}
8 8
 
@@ -85,7 +85,6 @@ end;
85 85
 var
86 86
 	TempDir: String;
87 87
 	InstallDir: String = '';
88
-	hK32: THandle;
89 88
 	i: Integer;
90 89
 	Reg: TRegistry;
91 90
 	handlerInfo: String;
@@ -98,10 +97,9 @@ begin
98 97
 		end;
99 98
 		InstallDir := trim(InstallDir);
100 99
 		KillDir(InstallDir);
101
-		hK32 := GetModuleHandle('kernel32');
102 100
 		profileDir := GetEnvironmentVariable('USERPROFILE');
103 101
 		
104
-		if GetProcAddress(hK32, 'GetLocaleInfoEx') <> nil then begin
102
+		if IsWindowsVista then begin
105 103
 			// Vista
106 104
 			KillDir(GetEnvironmentVariable('APPDATA')+'\Microsoft\Windows\Start Menu\Programs\DMDirc');
107 105
 			DeleteFile(GetEnvironmentVariable('USERPROFILE')+'\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\DMDirc.lnk');

+ 1
- 3
launcher/windows/DMDirc.dpr View File

@@ -82,7 +82,6 @@ var
82 82
 	cliParams: String = '';
83 83
 	directory: String = '';
84 84
 	i: integer;
85
-	hK32: THandle;
86 85
 	jarName: String;
87 86
 	launcherUpdate: boolean = false;
88 87
 begin
@@ -105,8 +104,7 @@ begin
105 104
 	launcherUpdate := FileExists(directory+'\.DMDirc.exe') and FileExists(directory+'\.DMDircUpdater.exe');
106 105
 	if FileExists(directory+'\.DMDirc.jar') or launcherUpdate then begin
107 106
 		// Vista Sucks.
108
-		hK32 := GetModuleHandle('kernel32');
109
-		if GetProcAddress(hK32, 'GetLocaleInfoEx') <> nil then begin
107
+		if IsWindowsVista then begin
110 108
 			// Vista >.<
111 109
 			// Try and delete the old file, if it fails then the user needs to give
112 110
 			// us permission to delete the file (UAC), otherwise we can just go ahead

BIN
launcher/windows/DMDirc.exe View File


BIN
launcher/windows/DMDircUpdater.exe View File


Loading…
Cancel
Save