user2408392
user2408392

Reputation: 1

Write permission for user who installed msi package

first of all, i'm not an expert programmer by any means so please excuse if my lingo is off.

I programmed a small project for school, basically it's just a simple cash register application. The user can select products to sell, create new products etc. When selling products, the user has the option to "print" a bill, ie the program fills a string with some information and creates a new textfile via streamwriter. Also, once the program gets closed, the current stock of products gets saved in a serialized file. The same file gets loaded every time the program starts.

Everything worked fine during debugging, however I created an msi package to test it and neither saving the textfile nor the serialized file works because apparently I don't have sufficient permission to do so.

Can someone tell me how to give the user who installed the programm with the msi the rights needed to make my program work?

Upvotes: 0

Views: 469

Answers (1)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 10993

I assume you are running on Vista or newer OS? This is the case where UAC prevents your normal applications to write to Programs Files (where again I assume you have installed the application).

The recommended locations to save user data are mentioned in this StackOverflow thread: Best place to save user information for Windows XP and Vista applications

You can also set permissions in the package during the installation using MsiLocakPermissions table, but I would not recommend it. Program Files folder should be used to store application resources, not user data.

Upvotes: 1

Related Questions