瀏覽代碼

Fix difference between Setup and SetupCustomStyle.

Martijn Laan 1 周之前
父節點
當前提交
77867f7ec3
共有 3 個文件被更改,包括 19 次插入18 次删除
  1. 1 1
      Projects/Setup.dpr
  2. 1 17
      Projects/SetupCustomStyle.dpr
  3. 17 0
      Projects/Src/Setup.Start.pas

+ 1 - 1
Projects/Setup.dpr

@@ -111,7 +111,7 @@ uses
 
 begin
   { Don't remove, see SetupCustomStyle.dpr }
-  Application.Title := 'Setup';
+  Application.Title := GetDefaultApplicationTitle;
 
   Start;
 end.

+ 1 - 17
Projects/SetupCustomStyle.dpr

@@ -119,26 +119,10 @@ uses
 
 { Note: Setup.Start.pas includes more resources }
 
-function GetDefaultTitle: String;
-var
-  ModuleName: array[0..255] of Char;
-begin
-  { Same code as in TApplication.Create }
-  GetModuleFileName(MainInstance, ModuleName, Length(ModuleName));
-  var P := AnsiStrRScan(ModuleName, '\');
-  if P <> nil then
-    StrCopy(ModuleName, P + 1);
-  P := AnsiStrScan(ModuleName, '.');
-  if P <> nil then
-    P^ := #0;
-  CharLower(CharNext(ModuleName));
-  Result :=  ModuleName;
-end;
-
 begin
   { This is a noop but makes the Delphi IDE show the Application->Appearance item in the
     project options. Removing it also stops generation of the SetupCustomStyle.res file. }
-  Application.Title := GetDefaultTitle;
+  Application.Title := GetDefaultApplicationTitle; { Using GetDefaultApplicationTitle instead of Application.Title to make actually make it a noop }
 
   Start;
 end.

+ 17 - 0
Projects/Src/Setup.Start.pas

@@ -11,6 +11,7 @@ unit Setup.Start;
 
 interface
 
+function GetDefaultApplicationTitle: String;
 procedure Start;
 
 implementation
@@ -33,6 +34,22 @@ uses
   SetupLdrAndSetup.Messages, SetupLdrAndSetup.InstFunc,
   Setup.LoggingFunc, Setup.MainFunc, Setup.Uninstall, Setup.RegSvr, Setup.MainForm;
 
+function GetDefaultApplicationTitle: String;
+var
+  ModuleName: array[0..255] of Char;
+begin
+  { Same code as in TApplication.Create }
+  GetModuleFileName(MainInstance, ModuleName, Length(ModuleName));
+  var P := AnsiStrRScan(ModuleName, '\');
+  if P <> nil then
+    StrCopy(ModuleName, P + 1);
+  P := AnsiStrScan(ModuleName, '.');
+  if P <> nil then
+    P^ := #0;
+  CharLower(CharNext(ModuleName));
+  Result := ModuleName;
+end;
+
 procedure ShowExceptionMsg;
 begin
   { Also see ShowExceptionMsg in Setup.Uninstall.pas }