LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File permission error

Solved!
Go to solution

Hey,

 

I have an installer with an application and a number of source files. One source file is a text file that gets placed in C:\Program Files. The application needs permission to write to this file. I've tried to remove this permission in the LabVIEW installer properties like below but no luck. I always have to manually add permission for the file by right click -> properties -> security -> edit permissions.

 

Installer.png

 

Is there anyway I can give LabVIEW application/installer permission to write to this location?

Strokes

0 Kudos
Message 1 of 6
(6,498 Views)

Is the person installing the application an admin on the PC?

 

If not, run the installer as an admin, or give the person admin rights.

Message 2 of 6
(6,492 Views)

Where does the error occur?

During build of the installer on the development machine?

During installing the software on the target machine?

 

One thing i think is creating an issue here is that <Program Files> is a secured folder by Windows security settings. You have to have administrative rights to modify files there or you have to grant permissions to specific applications (afaik for each "session" again and again).

The best solution for this would be to follow recommendations from Microsoft and store that file in <Public Documents>\YourApplicationDirectory.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 6
(6,491 Views)

Cheers guys,

 

The person installing the application may or may not have admin rights on the target PC. It will be a consumer application so we want to cover all basis.

 

The error occurs when the application tries to write to the file that the installer has placed in C:\Program files

0 Kudos
Message 4 of 6
(6,481 Views)
Solution
Accepted by Strokes

So the installer places the file correctly, but modifying the content fails with the error?

 

So it is a we already guessed: You are running into an OS permission issue.

Solutions:

- Use an old version of Windows (e.g. XP) as it does not check for privileges when accessing <program files>

- Start (using a batchfile) an EXE after installation which alters the file. Remember to include commands to run that EXE as admin

- Ask your IT to provide every user the superadmin permissions (don't know if Win 7 and newer even grant that option)

- Or simply don't use that folder as the OS prevents modification to existing files without admin permissions

 

Sorry, it is a limitation (security feature) of the OS and there is nothing the installer can do about it.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 6
(6,467 Views)

This problem is only going to get worse in the future.  XP is going by the wayside.  Our company is supposed to have everyone upgraded to Win7 by the end of this year.

 

If it is a file that is supposed to be modified by the application after it is installed, then the program files directory is probably not the correct place for it.  I would redesign the application so that it places the file and modifies it in a location such as Public Application Data if all users need to access the same file or User Application Data if the file would need to be different between different users.

Message 6 of 6
(6,451 Views)