<arg choice="opt" rep="norepeat"><option>/cfg</option>
<replaceable>name=value</replaceable></arg>
+ <arg choice="opt" rep="norepeat"><option>/inifile</option>
+ <replaceable>inifile</replaceable></arg>
+
<arg choice="plain"
rep="norepeat"><replaceable>leftpath</replaceable></arg>
</listitem>
</varlistentry>
+ <varlistentry>
+ <indexterm>
+ <primary>ini file</primary>
+ <secondary>specifying on command line</secondary>
+ </indexterm>
+
+ <term><option>/inifile <replaceable>inifile</replaceable></option></term>
+ <listitem>
+ <para>specifies an INI file used to load and save settings instead of the registry.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</article>
<arg choice="opt" rep="norepeat"><option>/cfg</option>
<replaceable>name=value</replaceable></arg>
+ <arg choice="opt" rep="norepeat"><option>/inifile</option>
+ <replaceable>inifile</replaceable></arg>
+
<arg choice="plain"
rep="norepeat"><replaceable>leftpath</replaceable></arg>
</varlistentry>
<varlistentry>
- <term><option>/dm</option></term>
+ <term><option>/dm</option></term>
<listitem>
<para><option>/dl</option>と同様に中央タイトルバーの説明を指定します。
</para>
</varlistentry>
<varlistentry>
- <term><option>/dr</option></term>
+ <term><option>/dr</option></term>
<listitem>
<para><option>/dl</option>と同様に右側タイトルバーの説明を指定します。
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <indexterm>
+ <primary>ini ファイル</primary>
+ <secondary>コマンドラインでの指定</secondary>
+ </indexterm>
+
+ <term><option>/inifile <replaceable>inifile</replaceable></option></term>
+ <listitem>
+ <para>レジストリの代わりに設定の読み込みと保存に使用するINIファイルを指定します。</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</article>
, m_mainThreadScripts(nullptr)
, m_nLastCompareResult(0)
, m_bNonInteractive(false)
-, m_pOptions(CreateOptionManager())
+, m_pOptions(nullptr)
, m_pGlobalFileFilter(new FileFilterHelper())
, m_nActiveOperations(0)
, m_pLangDlg(new CLanguageSelect())
* @return IniOptionsMgr if initial config file exists,
* CRegOptionsMgr otherwise.
*/
-COptionsMgr *CreateOptionManager()
+COptionsMgr *CreateOptionManager(const MergeCmdLineInfo& cmdInfo)
{
- String iniFilePath = paths::ConcatPath(env::GetProgPath(), _T("winmerge.ini"));
- if (paths::DoesPathExist(iniFilePath) == paths::IS_EXISTING_FILE)
+ String iniFilePath = cmdInfo.m_sIniFilepath;
+ if (!iniFilePath.empty())
{
- return new CIniOptionsMgr(iniFilePath);
- }
- else
- {
- return new CRegOptionsMgr();
+ if (paths::CreateIfNeeded(paths::GetParentPath(iniFilePath)))
+ return new CIniOptionsMgr(iniFilePath);
}
+ iniFilePath = paths::ConcatPath(env::GetProgPath(), _T("winmerge.ini"));
+ if (paths::DoesPathExist(iniFilePath) == paths::IS_EXISTING_FILE)
+ return new CIniOptionsMgr(iniFilePath);
+ return new CRegOptionsMgr();
}
CMergeApp::~CMergeApp()
#else
MergeCmdLineInfo cmdInfo(GetCommandLine());
#endif
+ m_pOptions.reset(CreateOptionManager(cmdInfo));
if (cmdInfo.m_bNoPrefs)
m_pOptions->SetSerializing(false); // Turn off serializing to registry.