05-26-2013 02:17 PM
Installer properities -> Destinations
Create a folder in the desired folder (Public App data I think)
Source Files -> Select the database file in the left column, select the desired folder in right column, click the to-the-right arrow
Much better is to create an executable, that does all the copy@move work for you how you want, then you select in the Advanced to run it after installation!
05-26-2013 10:57 PM
Friend dkfire,
Althought problem is solved but I would like to say is in my project my database file and exe file is in same folder under program file. but then also I am writing and reading without any problem.
Are you saying in above condition this wont work ?
05-27-2013 02:08 AM
What version of Windows are you using ?
Windows 7 has change the security for the Program files folder. No program are allowed to wirte in any folder to any files there, unless you have disabled the security.
You should never place a mdb file under Program Files folder, but under the program data folder.
05-27-2013 02:10 AM
If you start the .exe with elevated privilegies, windows will let it do anything...
05-27-2013 03:02 AM
I am using Professional. That is the best place for mdb file becasue when installing apart from EXE file that will also inside executable folder.
What is program data folder ?
05-27-2013 03:45 AM
@Ranjeet_Singh wrote:
I am using Professional.
What Professional ? Windows XP, Vista or 7 ?
@Ranjeet_Singh wrote:
That is the best place for mdb file becasue when installing apart from EXE file that will also inside executable folder.
As already metiond, the installer can take care about placing the files in the right folders, as long as you setup the installer correct.
@Ranjeet_Singh wrote:
What is program data folder ?
The Program Data folder, is the folder on a windows PC where any files that is generated or altered by a program has to be saved, unless it is a user document.
The Program Data folder is placed diffrent on Windows XP compared to Windows 7.
On XP you can find it at:
For all users:
On 7 you can find it at :
For all users:
C:\Program Data
For each user:
C:\Users\(User Name)\AppData\...
(There are 3 folders there, but I currently don't know the difference)
Hope this help you.
05-27-2013 04:07 AM
As the discussion started from Win-7. I am also using same.
When creating the installer we need to provide the path for database it will not take automatically.
This is my C drive, can you please tell me where is Program Data folder ? I cant even find Program Data.
05-27-2013 05:58 AM
Program Data is a hidden folder on the C-drive.
You need to change your view option for the folder to be able to see it.
05-27-2013 06:04 AM
@dkfire wrote:
Program Data is a hidden folder on the C-drive.
You need to change your view option for the folder to be able to see it.
If my user want to see the database then I can't tell him that Please go to C then make the visible.
See in my application user may want to see the data. And this is portable also that if I want to run my installer other PC also (Ofcourse run time is already installed) Then I can copy only my EXE file so database will also be installed and user can write / read database. This is more generic for me and suits my application hence I always opt for this only.
05-27-2013 06:26 AM - edited 05-27-2013 06:28 AM
The reason to use the standard foldering is because it is standard.
This is the way microsoft wants programmers to do this. If you disagree and use whatever workaround, you might get into trouble in the future.
The folder is not visible because, the standard user should not mess with the program data directly. That is what the program is supposed to do.