使用 innosetup 打包的共享软件 vb.net 应用程序,安装在不同的目录中创建 2 个不同的应用程序集

发布于 2024-09-09 09:57:35 字数 475 浏览 3 评论 0原文

我使用 vb.net Visual Studio 2008 for Windows 桌面创建了一个共享软件应用程序,并使用 innosetup 5.3.8 将其打包。问题是,当我将应用程序安装在 C:\Program Files\Application 中并成功运行(使用应用程序的试用期)时,我还可以通过安装在不同的目录中,使用相同的设置再次重新安装应用程序。例如 C:\Program Files\Application new 。 C:\Program Files\Application new 中的应用程序没有任何已安装应用程序的设置。

我哪里错了。我需要在我的应用程序(vb.net)或 innosetup 中处理这个问题吗?如何处理 innosetup 中已安装的路径或通过升级旧的应用程序将已安装的应用程序的设置转移到新安装的路径。

我不想在注册表中写入任何内容,因为应用程序不需要任何管理权限要求。如果我在同一路径中安装应用程序,它就会更新,旧的设置将被接管到新的设置中,并且工作正常。

I have created an shareware application using vb.net visual studio 2008 for windows desktop, and packaged it using innosetup 5.3.8. The problem is when i have installed the application in C:\Program Files\Application and it runs successfully(use trial period of the application), Im also able to install the application once again freshly with the same setup by installing in different directory.eg C:\Program Files\Application new . The application in C:\Program Files\Application new does not have any settings of the already installed one.

Where do i went wrong . Do i need to take care of this in my application(vb.net) or innosetup. How to take care of the already installed path in innosetup or carry the settings of already installed application to newly installed path by upgrading the older one.

I dont want to write any thing in registry because the application does not want any administrative permission requirements.If i install the application in same path it gets updated with the older settings being taken over to this new one and it works fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与君绝 2024-09-16 09:57:35

Windows 应用程序通常将其设置保存在注册表中的 HKEY_CURRENT_USER\Software\YourCompany\YourApp 下,或作为文件保存在 %APPDATA%\YourCompany\YourApp 下。无需管理员权限即可写入这两个位置,并且这两个位置都是特定于用户的。也就是说,如果两个用户使用同一台计算机,则两个用户都可以通过自己的设置使用您的应用程序,而不会影响另一个用户。

您绝对不应该在 c:\Program Files 下保存任何设置。写入 Program Files 文件夹需要管理员权限。如果您的应用程序没有清单,则写入程序文件可能会起作用。真正发生的情况是,您写入 Program Files 文件夹的文件被重新路由到 VirtualStore。除非系统管理员禁用了 VirtualStore。那么你的申请就会失败。

如果您希望应用程序健壮,则应仅将设置保存到 HKEY_CURRENT_USER\Software\YourCompany\YourApp 和/或 %APPDATA%\YourCompany\YourApp。如果在这些位置中找不到以前保存的设置,您的应用程序应使用其默认设置。

Windows applications normally save their settings in the registry under HKEY_CURRENT_USER\Software\YourCompany\YourApp or as files under %APPDATA%\YourCompany\YourApp. Both locations can be written to without admin privileges, and both locations are user-specific. That is, if two users use the same computer, both can use your application with their own settings without affecting the other user.

You should never save any settings under c:\Program Files. Writing to the Program Files folder requires admin privileges. If your application does not have a manifest then writing to Program Files may appear to work. What is really happening is that the files you're writing to the Program Files folder are rerouted to the VirtualStore. Unless the system administrator has disabled the VirtualStore. Then your application will fail.

If you want your application to be robust, it should only save settings to HKEY_CURRENT_USER\Software\YourCompany\YourApp and/or %APPDATA%\YourCompany\YourApp. Your application should use its default setting if no previously saved settings can be found in these locations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文