Click here to Skip to main content
15,944,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When we install the Windows application setup file then it is giving different results.

If I install in Windows XP it is copying the files in the path C\Programme Files\Application. In XP application is working without any issues in all machines.

But if I install same setup in Win7 then it is copying in the C\Programme Files\ only.All the files are placed in C:\Programe files and application is not working.

If I copy individual files and paste inside the C:\Programme Files\Application then again it started working.

Request you to help me in resolving this issue.

Thanks in advance.
Posted
Updated 31-Jan-12 6:04am
v2

1 solution

Different operating system will behave differently. Your application should NOT rely on absolute paths.

You can achieve this by adding just a few lines of code. Check if a path exists or not. If not create it. But you must be very careful while choosing a path. You may not know under what permissions your application will run. So choose your directory structure appropriately. For ex - if your application isn't running under administrator privilege or if there is a antivirus protection on with a higher security, you may not be allowed to create files/folder in the system directory and even in the windows and program files folder. But you will usually have rights to create files/folders inside you application folder. So design your app accordingly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900