svnno****@sourc*****
svnno****@sourc*****
2016年 9月 7日 (水) 22:14:02 JST
Revision: 6486 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6486 Author: maya Date: 2016-09-07 22:14:02 +0900 (Wed, 07 Sep 2016) Log Message: ----------- アンインストーラに /SUPPRESSMSGBOXES が指定されているときは、MsgBox で設定ファイルの削除を問い合わせない(削除しない) Modified Paths: -------------- trunk/installer/teraterm.iss -------------- next part -------------- Modified: trunk/installer/teraterm.iss =================================================================== --- trunk/installer/teraterm.iss 2016-08-31 12:55:20 UTC (rev 6485) +++ trunk/installer/teraterm.iss 2016-09-07 13:14:02 UTC (rev 6486) @@ -873,7 +873,8 @@ conf : String; confmsg : String; app : String; - i, res : integer; + i, res : Integer; + silent : Boolean; begin case CurUninstallStep of usPostUninstall: @@ -888,26 +889,37 @@ conf := CustomMessage('msg_del_confirm'); app := ExpandConstant('{app}'); - // delete config files - for i := 0 to 5 do + silent := false; + for i := 0 to ParamCount() do begin - buf := app + ini[i]; - if FileExists(buf) then begin - confmsg := Format(conf, [buf]); + if (CompareText('/SUPPRESSMSGBOXES', ParamStr(i)) = 0) then + silent := true; + end; + + if not silent then begin + + // delete config files + for i := 0 to 5 do + begin + buf := app + ini[i]; + if FileExists(buf) then begin + confmsg := Format(conf, [buf]); + res := MsgBox(confmsg, mbInformation, MB_YESNO or MB_DEFBUTTON2); + if res = IDYES then + DeleteFile(buf); + end; + end; + + // delete registory + if RegKeyExists(HKEY_CURRENT_USER, 'Software\ShinpeiTools\TTermMenu') then begin + confmsg := Format(conf, ['HKEY_CURRENT_USER' + '\Software\ShinpeiTools\TTermMenu']); res := MsgBox(confmsg, mbInformation, MB_YESNO or MB_DEFBUTTON2); - if res = IDYES then - DeleteFile(buf); + if res = IDYES then begin + RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\ShinpeiTools\TTermMenu'); + RegDeleteKeyIfEmpty(HKEY_CURRENT_USER, 'Software\ShinpeiTools'); + end; end; - end; - // delete registory - if RegKeyExists(HKEY_CURRENT_USER, 'Software\ShinpeiTools\TTermMenu') then begin - confmsg := Format(conf, ['HKEY_CURRENT_USER' + '\Software\ShinpeiTools\TTermMenu']); - res := MsgBox(confmsg, mbInformation, MB_YESNO or MB_DEFBUTTON2); - if res = IDYES then begin - RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\ShinpeiTools\TTermMenu'); - RegDeleteKeyIfEmpty(HKEY_CURRENT_USER, 'Software\ShinpeiTools'); - end; end; SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);