[Ttssh2-commit] [4354] 4.69-RC3

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 3日 (木) 00:13:21 JST


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

Log Message:
-----------
4.69-RC3

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


-------------- next part --------------
Modified: trunk/installer/teraterm.iss
===================================================================
--- trunk/installer/teraterm.iss	2011-02-28 15:56:53 UTC (rev 4353)
+++ trunk/installer/teraterm.iss	2011-03-02 15:13:21 UTC (rev 4354)
@@ -1,5 +1,5 @@
 #define AppName "Tera Term"
-#define AppVer "4.69-RC2"
+#define AppVer "4.69-RC3"
 ;#define snapshot GetDateTimeString('yyyymmdd_hhnnss', '', '');
 
 [Setup]
@@ -16,7 +16,7 @@
 ShowLanguageDialog=yes
 AllowNoIcons=true
 UninstallDisplayIcon={app}\ttermpro.exe
-AppMutex=TeraTermProAppMutex, TeraTermProMacroAppMutex, TeraTermProKeycodeAppMutex, TeraTermMenuAppMutex, CygTermAppMutex, Global\TeraTermProAppMutex, Global\TeraTermProMacroAppMutex, Global\TeraTermProKeycodeAppMutex, Global\TeraTermMenuAppMutex, Global\CygTermAppMutex
+;AppMutex=TeraTermProAppMutex, TeraTermProMacroAppMutex, TeraTermProKeycodeAppMutex, TeraTermMenuAppMutex, CygTermAppMutex, Global\TeraTermProAppMutex, Global\TeraTermProMacroAppMutex, Global\TeraTermProKeycodeAppMutex, Global\TeraTermMenuAppMutex, Global\CygTermAppMutex
 #ifndef snapshot
 OutputBaseFilename=teraterm-{#AppVer}
 #else
@@ -282,6 +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
 
 [Code]
 const
@@ -357,6 +359,73 @@
 end;
 }
 
+function CheckAppUsing(Filename:String) : integer;
+var
+  TmpFileName : String;
+begin
+  if FileExists(FileName) then
+    begin
+      TmpFileName := FileName + '.' + GetDateTimeString('yyyymmddhhnnss', #0, #0); // Tmp file ends with timestamp
+      if FileCopy(FileName, TmpFileName, True) then
+        if DeleteFile(FileName) then
+          if RenameFile(TmpFileName, FileName) then
+            Result := 0
+          else
+            Result := -1 // permission?
+        else
+          begin
+            Result := 1; // failed to delete
+            DeleteFile(TmpFileName);
+          end
+      else
+        Result := -1 // permission?
+    end
+  else
+    Result := 0;
+end;
+
+function CheckAppsUsing() : integer;
+var
+  FileDir  : String;
+  FileName : array[0..6] of String;
+  i        : integer;
+  flag     : boolean;
+begin
+  FileDir := ExpandConstant('{app}');
+  FileName[0] := FileDir + '\ttermpro.exe';
+  FileName[1] := FileDir + '\ttpmacro.exe';
+  FileName[2] := FileDir + '\keycode.exe';
+  FileName[3] := FileDir + '\ttpmenu.exe';
+  FileName[4] := FileDir + '\cygterm.exe';
+  FileName[5] := FileDir + '\Collector.exe';
+  FileName[6] := FileDir + '\Collector_org.exe';
+  
+  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;
+    end;
+  end;
+
+end;
+
 function GetDefaultIniFilename : String;
 begin
   Result := ExpandConstant('{app}') + '\TERATERM.INI';
@@ -537,6 +606,8 @@
   ResultCode: Integer;
   iniFile : String;
 begin
+  Result := True;
+
   case CurPageID of
 
     wpWelcome:
@@ -570,6 +641,19 @@
 
       end;
 
+    wpSelectDir:
+      begin
+
+        ResultCode := CheckAppsUsing();
+        if ResultCode = 1 then
+          begin
+            MsgBox(CustomMessage('msg_AppRunningError'), mbError, MB_OK);
+            Result := False;
+          end;
+        // if -1, goto next. turn over to Inno Setup.
+
+      end;
+
     wpSelectComponents:
       begin
 
@@ -588,7 +672,6 @@
 
       end;
   end;
-  Result := True;
 end;
 
 procedure CurStepChanged(CurStep: TSetupStep);



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