--- trunk/installer/teraterm.iss 2011/02/28 15:56:53 4353 +++ trunk/installer/teraterm.iss 2011/09/03 15:15:43 4617 @@ -1,6 +1,6 @@ #define AppName "Tera Term" -#define AppVer "4.69-RC2" -;#define snapshot GetDateTimeString('yyyymmdd_hhnnss', '', ''); +#define AppVer "4.71" +#define snapshot GetDateTimeString('yyyymmdd_hhnnss', '', ''); [Setup] AppCopyright=TeraTerm Project @@ -16,7 +16,6 @@ ShowLanguageDialog=yes AllowNoIcons=true UninstallDisplayIcon={app}\ttermpro.exe -AppMutex=TeraTermProAppMutex, TeraTermProMacroAppMutex, TeraTermProKeycodeAppMutex, TeraTermMenuAppMutex, CygTermAppMutex, Global\TeraTermProAppMutex, Global\TeraTermProMacroAppMutex, Global\TeraTermProKeycodeAppMutex, Global\TeraTermMenuAppMutex, Global\CygTermAppMutex #ifndef snapshot OutputBaseFilename=teraterm-{#AppVer} #else @@ -74,8 +73,8 @@ Source: ..\cygterm\cygterm.cfg; DestDir: {app}; Components: cygterm; Flags: onlyifdoesntexist uninsneveruninstall; Permissions: authusers-modify Source: ..\cygterm\cyglaunch.exe; DestDir: {app}; Components: cygterm Source: ..\cygterm\cygterm+.tar.gz; DestDir: {app}; Components: cygterm -Source: ..\libs\logmett\Setup_LogMeTT_2_9_8_1.exe; DestDir: {tmp}; Components: LogMeTT; Flags: deleteafterinstall -Source: ..\libs\logmett\Setup_TTLEditor_1_2_1.exe; DestDir: {tmp}; Components: TTLEdit; Flags: deleteafterinstall +Source: ..\libs\logmett\Setup_LogMeTT_2_9_9_1.exe; DestDir: {tmp}; Components: LogMeTT; Flags: deleteafterinstall +Source: ..\libs\logmett\Setup_TTLEditor_1_3.exe; DestDir: {tmp}; Components: TTLEdit; Flags: deleteafterinstall Source: ..\ttpmenu\Release\ttpmenu.exe; DestDir: {app}; Components: TeraTerm_Menu; Flags: ignoreversion Source: release\ttmenu_readme-j.txt; DestDir: {app}; Components: TeraTerm_Menu Source: ..\TTProxy\Release\TTXProxy.dll; DestDir: {app}; Components: TTProxy; Flags: ignoreversion @@ -114,8 +113,8 @@ Name: TeraTerm; Description: Tera Term & Macro; Flags: fixed; Types: custom compact full standard Name: TTSSH; Description: TTSSH; Types: compact full standard Name: cygterm; Description: CygTerm+; Types: full standard; Check: not isIA64 -Name: LogMeTT; Description: LogMeTT; Types: full standard; MinVersion: 4.1.1998,4.0.1381sp6 -Name: TTLEdit; Description: TTLEdit; Types: full standard; MinVersion: 4.1.1998,4.0.1381sp6 +Name: LogMeTT; Description: LogMeTT ({cm:comp_installer}); Types: full; MinVersion: 4.1.1998,4.0.1381sp6 +Name: TTLEdit; Description: TTLEdit ({cm:comp_installer}); Types: full; MinVersion: 4.1.1998,4.0.1381sp6 Name: TeraTerm_Menu; Description: TeraTerm Menu; Types: full Name: TTProxy; Description: TTProxy; Types: full standard Name: Collector; Description: Collector; Types: full @@ -145,9 +144,9 @@ [Registry] ; Cygterm Here Root: HKCU; Subkey: Software\Classes\Folder\shell\cygterm; ValueType: string; ValueData: Cy>erm Here; Flags: uninsdeletekey; Check: isWin2kOrLater; Components: cygterm; Tasks: cygtermhere -Root: HKCU; Subkey: Software\Classes\Folder\shell\cygterm\command; ValueType: string; ValueData: """{app}\cyglaunch.exe"" -nocd -nols -d \""%L\"""; Flags: uninsdeletekey; Check: isWin2kOrLater; Components: cygterm; Tasks: cygtermhere +Root: HKCU; Subkey: Software\Classes\Folder\shell\cygterm\command; ValueType: string; ValueData: """{app}\cyglaunch.exe"" -nocd -nols -d ""\""%L\"""""; Flags: uninsdeletekey; Check: isWin2kOrLater; Components: cygterm; Tasks: cygtermhere Root: HKCR; Subkey: Folder\shell\cygterm; ValueType: string; ValueData: Cy>erm Here; Flags: uninsdeletekey; Check: not isWin2kOrLater; Components: cygterm; Tasks: cygtermhere -Root: HKCR; Subkey: Folder\shell\cygterm\command; ValueType: string; ValueData: """{app}\cyglaunch.exe"" -nocd -nols -d \""%L\"""; Flags: uninsdeletekey; Check: not isWin2kOrLater; Components: cygterm; Tasks: cygtermhere +Root: HKCR; Subkey: Folder\shell\cygterm\command; ValueType: string; ValueData: """{app}\cyglaunch.exe"" -nocd -nols -d ""\""%L\"""""; Flags: uninsdeletekey; Check: not isWin2kOrLater; Components: cygterm; Tasks: cygtermhere ; Associate with .TTL Root: HKCU; Subkey: Software\Classes\.ttl; ValueType: string; ValueData: TeraTerm.MacroFile; Flags: uninsdeletekey; Check: isWin2kOrLater; Components: TeraTerm; Tasks: macroassoc Root: HKCU; Subkey: Software\Classes\TeraTerm.MacroFile; ValueType: string; ValueData: Tera Term Macro File; Flags: uninsdeletekey; Check: isWin2kOrLater; Components: TeraTerm; Tasks: macroassoc @@ -208,8 +207,8 @@ [Run] Filename: {app}\ttermpro.exe; Flags: nowait postinstall skipifsilent unchecked; Description: {cm:launch_teraterm}; Components: TeraTerm -Filename: {tmp}\Setup_LogMeTT_2_9_7.exe; Components: LogMeTT -Filename: {tmp}\Setup_TTLEditor_1_2_1.exe; Components: TTLEdit +Filename: {tmp}\Setup_LogMeTT_2_9_9_1.exe; Components: LogMeTT +Filename: {tmp}\Setup_TTLEditor_1_3.exe; Components: TTLEdit Filename: {app}\ttpmenu.exe; Flags: nowait postinstall skipifsilent unchecked; Description: {cm:launch_ttmenu}; Components: TeraTerm_Menu Filename: {app}\Collector\Collector.exe; Flags: nowait postinstall skipifsilent unchecked; Description: {cm:launch_collector}; Components: Collector @@ -282,6 +281,10 @@ ja.comp_TTXAlwaysOnTop=常に最前面に表示できるようにする en.comp_TTXRecurringCommand=Recurring Command can be used ja.comp_TTXRecurringCommand=定期的に文字列を送信する +en.comp_installer=Other installer is started +ja.comp_installer=インストーラが起動します +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=セットアップは実行中の %s を検出しました。%n%n開いているアプリケーションをすべて閉じてから「次へ」をクリックしてください。 [Code] const @@ -357,6 +360,74 @@ end; } +function CheckFileUsing(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() : string; +var + FileDir : String; + FileName : array[0..6] of String; + FileDesc : array[0..6] of String; + i : integer; +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'; + 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'; + + for i := 0 to 6 do + begin + 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; + +end; + function GetDefaultIniFilename : String; begin Result := ExpandConstant('{app}') + '\TERATERM.INI'; @@ -380,7 +451,7 @@ VTFont := GetIniString('Tera Term', 'VTFont', '', iniFile); TEKFont := GetIniString('Tera Term', 'TEKFont', '', iniFile); FileDir := GetIniString('Tera Term', 'FileDir', '', iniFile); - FileDir := GetIniString('Tera Term', 'FileDir', '', iniFile); + TCPPort := GetIniInt('Tera Term', 'TCPPort', 0, 0, 65535, iniFile) ViewlogEditor := GetIniString('Tera Term', 'ViewlogEditor', '', iniFile); case GetUILanguage and $3FF of @@ -406,7 +477,7 @@ if CodePage = 0 then SetIniInt('Tera Term', 'CodePage', 932, iniFile); if Length(VTFont) = 0 then - SetIniString('Tera Term', 'VTFont', 'MS 明朝,0,-16,128', iniFile); + SetIniString('Tera Term', 'VTFont', 'Terminal,0,-19,128', iniFile); if Length(TEKFont) = 0 then SetIniString('Tera Term', 'TEKFont', 'Terminal,0,-8,128', iniFile); end; @@ -534,9 +605,12 @@ var uninstaller : String; uninstaller2 : String; - ResultCode: Integer; - iniFile : String; + ResultCode : Integer; + iniFile : String; + ErrMsg : String; begin + Result := True; + case CurPageID of wpWelcome: @@ -570,6 +644,21 @@ end; + wpSelectDir: + begin + + ErrMsg := CheckAppsUsing(); + if Length(ErrMsg) > 0 then + begin + MsgBox(Format(CustomMessage('msg_AppRunningError'), [ErrMsg]), mbError, MB_OK); + Result := False; + end + else + // -1: goto next. Turn over to Inno Setup. + // 0: goto next. No problem. + // NOP + end; + wpSelectComponents: begin @@ -588,7 +677,6 @@ end; end; - Result := True; end; procedure CurStepChanged(CurStep: TSetupStep); @@ -708,6 +796,9 @@ Name: {app}\libeay.txt; Type: files [InnoIDE_PreCompile] -;Name: makechm.bat +Name: makechm.bat +Name: build.bat ;Name: build.bat; Parameters: rebuild -;Name: build.bat + +[InnoIDE_PostCompile] +;Name: makearchive.bat; Parameters: release