PUSHBUTTON "\92\86\8e~(&S)",UPDOWNAS_STOP,101,66,50,14\r
END\r
\r
+ini_from_reg_dlg DIALOG 0, 0, 211, 64\r
+STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION\r
+CAPTION "\83\8c\83W\83X\83g\83\8a\82Ì\90Ý\92è\82Ì\83C\83\93\83|\81[\83g"\r
+FONT 9, "MS Shell Dlg"\r
+BEGIN\r
+ LTEXT "INI\83t\83@\83C\83\8b\82ð\8eg\97p\82·\82é\82æ\82¤\82É\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82·\82ª\81AINI\83t\83@\83C\83\8b\82Å\82Í\82È\82\83\8c\83W\83X\83g\83\8a\82É\90Ý\92è\82ª\91¶\8dÝ\82·\82é\82±\82Æ\82ð\8c\9f\8fo\82µ\82Ü\82µ\82½\81B\r\n\83\8c\83W\83X\83g\83\8a\82Ì\90Ý\92è\82ð\83C\83\93\83|\81[\83g\82µ\82Ü\82·\82©\81B",-1,7,7,196,36\r
+ DEFPUSHBUTTON "\82Í\82¢",IDOK,48,42,50,14\r
+ PUSHBUTTON "\82¢\82¢\82¦",IDCANCEL,112,42,50,14\r
+END\r
+\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
forcepasschange_dlg, DIALOG\r
BEGIN\r
LEFTMARGIN, 7\r
- RIGHTMARGIN, 139\r
+ RIGHTMARGIN, 204\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 43\r
+ BOTTOMMARGIN, 57\r
END\r
\r
opt_trmode2_dlg, DIALOG\r
updatesslroot_dlg, DIALOG\r
BEGIN\r
LEFTMARGIN, 7\r
- RIGHTMARGIN, 139\r
+ RIGHTMARGIN, 204\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 43\r
+ BOTTOMMARGIN, 57\r
END\r
\r
updown_as_with_ext_dlg, DIALOG\r
LEFTMARGIN, 7\r
RIGHTMARGIN, 180\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 87\r
+ BOTTOMMARGIN, 82\r
+ END\r
+\r
+ ini_from_reg_dlg, DIALOG\r
+ BEGIN\r
+ LEFTMARGIN, 7\r
+ RIGHTMARGIN, 204\r
+ TOPMARGIN, 7\r
+ BOTTOMMARGIN, 57\r
END\r
END\r
#endif // APSTUDIO_INVOKED\r
#define savecrypt_dlg 191\r
#define updatesslroot_dlg 192\r
#define updown_as_with_ext_dlg 193\r
+#define ini_from_reg_dlg 194\r
#define TRANS_TIME_BAR 1002\r
#define TRANS_TEXT 1003\r
#define TRANS_REMOTE 1003\r
// \r
#ifdef APSTUDIO_INVOKED\r
#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE 193\r
+#define _APS_NEXT_RESOURCE_VALUE 195\r
#define _APS_NEXT_COMMAND_VALUE 40177\r
#define _APS_NEXT_CONTROL_VALUE 1213\r
#define _APS_NEXT_SYMED_VALUE 101\r
PUSHBUTTON "Cancel",UPDOWNAS_STOP,101,66,50,14\r
END\r
\r
+ini_from_reg_dlg DIALOG 0, 0, 211, 64\r
+STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION\r
+CAPTION "Import settings from registry"\r
+FONT 9, "MS Shell Dlg"\r
+BEGIN\r
+ LTEXT "The INI file that will be used was not found, but settings are detected in the registry.\r\nImport settings from the registry to the INI file?",-1,7,7,196,36\r
+ DEFPUSHBUTTON "Yes",IDOK,48,42,50,14\r
+ PUSHBUTTON "No",IDCANCEL,112,42,50,14\r
+END\r
+\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
forcepasschange_dlg, DIALOG\r
BEGIN\r
LEFTMARGIN, 7\r
- RIGHTMARGIN, 139\r
+ RIGHTMARGIN, 204\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 43\r
+ BOTTOMMARGIN, 57\r
END\r
\r
opt_trmode2_dlg, DIALOG\r
updatesslroot_dlg, DIALOG\r
BEGIN\r
LEFTMARGIN, 7\r
- RIGHTMARGIN, 139\r
+ RIGHTMARGIN, 204\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 43\r
+ BOTTOMMARGIN, 57\r
END\r
\r
updown_as_with_ext_dlg, DIALOG\r
LEFTMARGIN, 7\r
RIGHTMARGIN, 180\r
TOPMARGIN, 7\r
- BOTTOMMARGIN, 87\r
+ BOTTOMMARGIN, 82\r
+ END\r
+\r
+ ini_from_reg_dlg, DIALOG\r
+ BEGIN\r
+ LEFTMARGIN, 7\r
+ RIGHTMARGIN, 204\r
+ TOPMARGIN, 7\r
+ BOTTOMMARGIN, 57\r
END\r
END\r
#endif // APSTUDIO_INVOKED\r
#define savecrypt_dlg 191\r
#define updatesslroot_dlg 192\r
#define updown_as_with_ext_dlg 193\r
+#define ini_from_reg_dlg 194\r
#define TRANS_TIME_BAR 1002\r
#define TRANS_TEXT 1003\r
#define TRANS_REMOTE 1003\r
// \r
#ifdef APSTUDIO_INVOKED\r
#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE 193\r
+#define _APS_NEXT_RESOURCE_VALUE 195\r
#define _APS_NEXT_COMMAND_VALUE 40177\r
#define _APS_NEXT_CONTROL_VALUE 1213\r
#define _APS_NEXT_SYMED_VALUE 101\r
void SaveRegistry(void);\r
int LoadRegistry(void);\r
void ClearRegistry(void);\r
+// ポータブル版判定\r
+void ClearIni(void);\r
void SetMasterPassword( const char* );\r
int GetMasterPasswordStatus(void);\r
int ValidateMasterPassword(void);\r
DWORD LoadHideDriveListRegistry(void);\r
void SaveSettingsToFile(void);\r
int LoadSettingsFromFile(void);\r
+// ポータブル版判定\r
+int IsRegAvailable();\r
+int IsIniAvailable();\r
\r
/*===== lvtips.c =====*/\r
\r
char PwdBuf[FMAX_PATH+1];\r
int useDefautPassword = 0; /* 警告文表示用 */\r
int masterpass;\r
+ // ポータブル版判定\r
+ int ImportPortable;\r
\r
sts = FFFTP_FAIL;\r
\r
GetModuleFileName(NULL, PortableFilePath, FMAX_PATH);\r
strcpy(GetFileName(PortableFilePath), "portable");\r
CheckPortableVersion();\r
+ ImportPortable = NO;\r
if(PortableVersion == YES)\r
{\r
ForceIni = YES;\r
RegType = REGTYPE_INI;\r
+ if(IsRegAvailable() == YES && IsIniAvailable() == NO)\r
+ {\r
+ if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(ini_from_reg_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)\r
+ {\r
+ ImportPortable = YES;\r
+ ForceIni = NO;\r
+ RegType = REGTYPE_REG;\r
+ }\r
+ }\r
}\r
\r
// AllocConsole();\r
{\r
LoadRegistry();\r
\r
+ // ポータブル版判定\r
+ if(ImportPortable == YES)\r
+ {\r
+ ForceIni = YES;\r
+ RegType = REGTYPE_INI;\r
+ }\r
+\r
// 暗号化通信対応\r
SetSSLTimeoutCallback(TimeOut * 1000, SSLTimeoutCallback);\r
SetSSLConfirmCallback(SSLConfirmCallback);\r
if(DialogBox(hInstFtp, MAKEINTRESOURCE(reginit_dlg), hWnd, ExeEscDialogProc) == YES)\r
{\r
ClearRegistry();\r
+ // ポータブル版判定\r
+ ClearIni();\r
SaveExit = NO;\r
PostMessage(hWnd, WM_CLOSE, 0, 0L);\r
}\r
{\r
GetListTabWidth();\r
SaveRegistry();\r
+ // ポータブル版判定\r
+ if(RegType == REGTYPE_REG)\r
+ ClearIni();\r
\r
if((CacheEntry > 0) && (CacheSave == YES))\r
SaveCache();\r
return r;\r
}\r
\r
+BOOL DeleteFileM(LPCSTR lpFileName)\r
+{\r
+ BOOL r = FALSE;\r
+ wchar_t* pw0 = NULL;\r
+START_ROUTINE\r
+ pw0 = DuplicateMtoW(lpFileName, -1);\r
+ r = DeleteFileW(pw0);\r
+END_ROUTINE\r
+ FreeDuplicatedString(pw0);\r
+ return r;\r
+}\r
+\r
int mkdirM(const char * _Path)\r
{\r
int r = -1;\r
#undef MoveFile\r
#define MoveFile MoveFileM\r
BOOL MoveFileM(LPCSTR lpExistingFileName, LPCSTR lpNewFileName);\r
+#undef DeleteFile\r
+#define DeleteFile DeleteFileM\r
+BOOL DeleteFileM(LPCSTR lpFileName);\r
#undef mkdir\r
#define mkdir _mkdirM\r
int mkdirM(const char * _Path);\r
}\r
\r
\r
+// ポータブル版判定\r
+void ClearIni(void)\r
+{\r
+// FILE *Strm;\r
+// if((Strm = fopen(AskIniFilePath(), "rt")) != NULL)\r
+// {\r
+// fclose(Strm);\r
+// MoveFileToTrashCan(AskIniFilePath());\r
+// }\r
+ DeleteFile(AskIniFilePath());\r
+ return;\r
+}\r
+\r
+\r
/*----- 設定をファイルに保存 --------------------------------------------------\r
*\r
* Parameter\r
{\r
REGDATATBL *Pos;\r
REGDATATBL *Next;\r
- FILE *Strm;\r
+ // ポータブル版判定\r
+// FILE *Strm;\r
\r
if(TmpRegType == REGTYPE_REG)\r
{\r
RegCloseKey(Handle);\r
\r
/* INIファイルを削除 */\r
- if((Strm = fopen(AskIniFilePath(), "rt")) != NULL)\r
- {\r
- fclose(Strm);\r
- MoveFileToTrashCan(AskIniFilePath());\r
- }\r
+ // ポータブル版判定\r
+// if((Strm = fopen(AskIniFilePath(), "rt")) != NULL)\r
+// {\r
+// fclose(Strm);\r
+// MoveFileToTrashCan(AskIniFilePath());\r
+// }\r
}\r
else\r
{\r
}\r
return rndValue;\r
}\r
+\r
+// ポータブル版判定\r
+int IsRegAvailable()\r
+{\r
+ int Sts;\r
+ void* h;\r
+ Sts = NO;\r
+ SetRegType(REGTYPE_REG);\r
+ if(OpenReg("FFFTP", &h) == FFFTP_SUCCESS)\r
+ {\r
+ CloseReg(h);\r
+ Sts = YES;\r
+ }\r
+ return Sts;\r
+}\r
+\r
+int IsIniAvailable()\r
+{\r
+ int Sts;\r
+ void* h;\r
+ Sts = NO;\r
+ SetRegType(REGTYPE_INI);\r
+ if(OpenReg("FFFTP", &h) == FFFTP_SUCCESS)\r
+ {\r
+ CloseReg(h);\r
+ Sts = YES;\r
+ }\r
+ return Sts;\r
+}\r
+\r