[Ttssh2-commit] [4356] 使用中でインストーラが先に進めない場合、そのアプリケーション名を表示するようにした

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 3日 (木) 21:40:18 JST


Revision: 4356
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4356
Author:   maya
Date:     2011-03-03 21:40:18 +0900 (Thu, 03 Mar 2011)

Log Message:
-----------
使用中でインストーラが先に進めない場合、そのアプリケーション名を表示するようにした

Modified Paths:
--------------
    trunk/installer/teraterm.iss


-------------- next part --------------
Modified: trunk/installer/teraterm.iss
===================================================================
--- trunk/installer/teraterm.iss	2011-03-03 11:17:20 UTC (rev 4355)
+++ trunk/installer/teraterm.iss	2011-03-03 12:40:18 UTC (rev 4356)
@@ -282,8 +282,8 @@
 ja.comp_TTXAlwaysOnTop=í‚ɍőO–Ê‚É•\Ž¦‚Å‚«‚é‚悤‚É‚·‚é
 en.comp_TTXRecurringCommand=Recurring Command can be used
 ja.comp_TTXRecurringCommand=’èŠú“I‚É•¶Žš—ñ‚𑗐M‚·‚é
-en.msg_AppRunningError=Setup has detected that Tera Term is currently running.%n%nPlease close all instances of it now, then click Next to continue.
-ja.msg_AppRunningError=ƒZƒbƒgƒAƒbƒv‚ÍŽÀs’†‚Ì Tera Term ‚ðŒŸo‚µ‚Ü‚µ‚½B%n%nŠJ‚¢‚Ä‚¢‚éƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ð‚·‚×‚Ä•Â‚¶‚Ä‚©‚çuŽŸ‚ցv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B
+en.msg_AppRunningError=Setup has detected that %s is currently running.%n%nPlease close all instances of it now, then click Next to continue.
+ja.msg_AppRunningError=ƒZƒbƒgƒAƒbƒv‚ÍŽÀs’†‚Ì %s ‚ðŒŸo‚µ‚Ü‚µ‚½B%n%nŠJ‚¢‚Ä‚¢‚éƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ð‚·‚×‚Ä•Â‚¶‚Ä‚©‚çuŽŸ‚ցv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B
 
 [Code]
 const
@@ -359,7 +359,7 @@
 end;
 }
 
-function CheckAppUsing(Filename:String) : integer;
+function CheckFileUsing(Filename:String) : integer;
 var
   TmpFileName : String;
 begin
@@ -384,12 +384,13 @@
     Result := 0;
 end;
 
-function CheckAppsUsing() : integer;
+function CheckAppsUsing() : string;
 var
   FileDir  : String;
   FileName : array[0..6] of String;
+  FileDesc : array[0..6] of String;
   i        : integer;
-  flag     : boolean;
+  ErrMsg   : String;
 begin
   FileDir := ExpandConstant('{app}');
   FileName[0] := FileDir + '\ttermpro.exe';
@@ -399,28 +400,29 @@
   FileName[4] := FileDir + '\cygterm.exe';
   FileName[5] := FileDir + '\Collector.exe';
   FileName[6] := FileDir + '\Collector_org.exe';
+  FileDesc[0] := 'Tera Term';
+  FileDesc[1] := 'Tera Term Macro';
+  FileDesc[2] := 'Keycode';
+  FileDesc[3] := 'TeraTerm Menu';
+  FileDesc[4] := 'CygTerm+';
+  FileDesc[5] := 'Collector';
+  FileDesc[6] := 'Collector';
   
-  flag := True;
   for i := 0 to 6 do
   begin
-    if flag = True then
-    begin
-      case CheckAppUsing(FileName[i]) of
-        1:
-          // failed to delete. in use.
-          begin
-            Result := 1;
-            flag := False;
-          end;
-        -1:
-          // failed to copy/rename
-          begin
-            Result := -1;
-            flag := False;
-          end;
-        else
-          // OK
-      end;
+    case CheckFileUsing(FileName[i]) of
+      1:
+        // Failed to delete. In use.
+        begin
+          if Length(Result) > 0 then
+            Result := Result + ', ' + FileDesc[i]
+          else
+            Result := FileDesc[i]
+        end;
+      else
+        // -1: Failed to copy/rename
+        //  0: OK
+        // NOP
     end;
   end;
 
@@ -603,8 +605,9 @@
 var
   uninstaller  : String;
   uninstaller2 : String;
-  ResultCode: Integer;
-  iniFile : String;
+  ResultCode   : Integer;
+  iniFile      : String;
+  ErrMsg       : String;
 begin
   Result := True;
 
@@ -644,14 +647,16 @@
     wpSelectDir:
       begin
 
-        ResultCode := CheckAppsUsing();
-        if ResultCode = 1 then
+        ErrMsg := CheckAppsUsing();
+        if Length(ErrMsg) > 0 then
           begin
-            MsgBox(CustomMessage('msg_AppRunningError'), mbError, MB_OK);
+            MsgBox(Format(CustomMessage('msg_AppRunningError'), [ErrMsg]), mbError, MB_OK);
             Result := False;
-          end;
-        // if -1, goto next. turn over to Inno Setup.
-
+          end
+        else
+        // -1: goto next. Turn over to Inno Setup.
+        //  0: goto next. No problem.
+        // NOP
       end;
 
     wpSelectComponents:



Ttssh2-commit メーリングリストの案内
Back to archive index