いずれかの OS (win7(x86) または win xp) で実行されるアプリケーションがあります。
私のプロジェクトは Visual Studio 2010 で設計されており、.Net 4.0 を使用しています。
以前は、プロパティのプロジェクトの「作業ディレクトリ」が win 7 用に指定されていましたが、プロジェクトをビルドすると、作業ディレクトリを見つけることができないと言われました( C:\Program Files(x86)\app
)
私は今、自分の作業をディレクトリとして変更しましたC:\Program Files\app
。私のアプリケーションは、MS Excel 2003 のプラグインとして機能します。そして今、実行できるようになりました。
では、アプリケーションを win xp と win 7 の両方で実行するにはどうすればよいですか?
WinForms .net 4.0 c# を使用しています。
private void MyMenuItem_Click(object sender, EventArgs e)
{
MyMenuItem.Enabled = false;
string installPath;
string helpFileName;
string appName;
installPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
appName = "\\MyApp\\";
if (System.IO.File.Exists(installPath + appName+ helpFileName))
{
System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control() installPath + appName + helpFileName,
System.Windows.Forms.HelpNavigator.TableOfContents);
}
}