运行应用程序时将示例文档安装到用户个人文件夹

时间:2021-07-16 22:38:31

I have a Basic MSI Project in InstallShield 2012 Spring. This project installs sample documents to the current user's Documents folder (Not the Public Documents folder). When I then log onto another user, I see the application installed, but I do not see those sample documents in the second user's Documents folder (this makes sense). My question is, is there a setting in InstallShield or a way to have the sample documents install for this second user when the second user launches the application? Can launching the application detect that there are files missing in the user's Documents folder and then trigger a repair?

我在InstallShield 2012 Spring中有一个基本的MSI项目。此项目将示例文档安装到当前用户的Documents文件夹(不是Public Documents文件夹)。当我然后登录到另一个用户时,我看到安装了该应用程序,但是我没有在第二个用户的Documents文件夹中看到这些示例文档(这很有意义)。我的问题是,在第二个用户启动应用程序时,是否有InstallShield中的设置或为第二个用户安装示例文档的方法?可以启动应用程序检测用户的Documents文件夹中是否缺少文件,然后触发修复?

1 个解决方案

#1


1  

While this is possible, I would not recommend it. The user should control what goes in his or her documents folder; the large number of applications out there that do not respect this is not a good reason for another not to do so. Instead the application should have a way to browse the samples, open them as templates, etc., and then allow the user to save them in the documents folder. If you need them to start in the documents folder, have the application copy them in, and track somewhere that it has done so.

虽然这是可能的,但我不推荐它。用户应该控制他或她的文档文件夹中的内容;那些不尊重这一点的大量申请并不是另一个不这样做的好理由。相反,应用程序应该有一种方法来浏览示例,打开它们作为模板等,然后允许用户将它们保存在文档文件夹中。如果您需要它们从文档文件夹开始,请让应用程序将它们复制,并跟踪它已经完成的任何地方。

If you do try to automatically install these through Windows Installer, the simplest approach is to make per-user components with key files reflecting the documents location, and ensure your application's shortcuts are advertised. Launching through an advertised shortcut will scan for missing key files, and then auto-repair will install them. But auto-repair is not an experience that users like, and this approach will replace the files if the user deletes them all. (Alternately you can use a per-user registry key as the indicator, which may be less likely to be deleted.)

如果您尝试通过Windows Installer自动安装这些,最简单的方法是使每个用户组件使用反映文档位置的密钥文件,并确保通告您的应用程序的快捷方式。通过广告快捷方式启动将扫描丢失的密钥文件,然后自动修复将安装它们。但是,自动修复并不是用户喜欢的体验,如果用户将文件全部删除,这种方法将替换文件。 (或者,您可以使用每用户注册表项作为指示符,这可能不太可能被删除。)

#1


1  

While this is possible, I would not recommend it. The user should control what goes in his or her documents folder; the large number of applications out there that do not respect this is not a good reason for another not to do so. Instead the application should have a way to browse the samples, open them as templates, etc., and then allow the user to save them in the documents folder. If you need them to start in the documents folder, have the application copy them in, and track somewhere that it has done so.

虽然这是可能的,但我不推荐它。用户应该控制他或她的文档文件夹中的内容;那些不尊重这一点的大量申请并不是另一个不这样做的好理由。相反,应用程序应该有一种方法来浏览示例,打开它们作为模板等,然后允许用户将它们保存在文档文件夹中。如果您需要它们从文档文件夹开始,请让应用程序将它们复制,并跟踪它已经完成的任何地方。

If you do try to automatically install these through Windows Installer, the simplest approach is to make per-user components with key files reflecting the documents location, and ensure your application's shortcuts are advertised. Launching through an advertised shortcut will scan for missing key files, and then auto-repair will install them. But auto-repair is not an experience that users like, and this approach will replace the files if the user deletes them all. (Alternately you can use a per-user registry key as the indicator, which may be less likely to be deleted.)

如果您尝试通过Windows Installer自动安装这些,最简单的方法是使每个用户组件使用反映文档位置的密钥文件,并确保通告您的应用程序的快捷方式。通过广告快捷方式启动将扫描丢失的密钥文件,然后自动修复将安装它们。但是,自动修复并不是用户喜欢的体验,如果用户将文件全部删除,这种方法将替换文件。 (或者,您可以使用每用户注册表项作为指示符,这可能不太可能被删除。)