从安装程序怎么能得到的路径,如何在我的应用程序设置?

问题描述:

我写一个双赢的应用程序,现在我想让设置为我的应用程序,我的代码是:

i am writing a win app and now i want to make setup for my app,my code is:

Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\Cu­rrentVersion\Run");
 rk.SetValue("MyAppName", @"C:\WhereMyAppIs\MyApp.exe");

现在从安装程序怎么能得到的路径来设置它?
感谢

now how can get the path from installer to set it??? thanks.

如果您使用Visual Studio,您可以直接在安装项目点击 - >查看 - > 。注册表,然后设置你喜欢的注册表项

If you use Visual Studio, you can right click on the setup project -> View -> Registry and then set the registry key you like.

看看这个网站:

msi - 设置安装路径注册表项

注册表设置管理(MSDN)