简体   繁体   中英

VS2015 Setup Project is not creating folders

So I've been using the 'Publishing' property until I realized it only did the install for the current logged in user. So I switch to the 'Setup Project' for VS 2015 which has the option to install for 'Everyone'.

Within my application I have a word template that I create a copy of. I then populate the new copy of the word template and then convert it to PDF for further processing.

The problem arose once I switched from a 'Published' application where everything was located in the User's folder and the files could be processed within there.

With it being installed in the program files directory I cannot access the files through the application.

I've attempted to add the folder structure within the 'View -> Editor -> File System' and set the 'AlwaysCreate' to 'True' but the folders are never created.

File System Screenshot: 文件系统

Outreach Folder Properties:

外联文件夹属性

I need to solve this because in the future I'd like to create more folders and documents that require read and write permissions.

It's hard to tell from that screenshot and your question which folder you're referring to. You don't need AlwaysCreate=true on the CommonFilesFolder. You don't need AlwaysCreate=true on any folder that will contain a file, as your screenshot seems to show with that docx file.

If your basic problem is for your app to have write/create access to a file on behalf of limited users, then the CommonFilesFolder won't work. If you look at the security of folders in there you'll see that Users don't have modify or create access. Without knowing if the files are shared between all users or each user has their own private copy it's not clear what the right answer is. However, if all users are sharing files and can update them, then the correct place is most likely the [CommonAppDataFolder] location. Files there can be written to by all users. For some reason Visual Studio setups don't know about this folder, but if you Add Special folder in the File System View and make the DefaultLocation to be [CommonAppDataFolder] then that will work, then add Manufacturer and Product name folders, the usual standard.

If users have their own private copies of files, then the best approach would probably be for your app to copy the default file to the User's Application Data\\Manufacturer\\Product for each user of the app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM