05-10-2015 04:18 AM
Hello
in my code there is simle open file .
in labview it works without any problem .
when i creat executable file it can't open file but when i run as admin it works fine .
here wht i have done :
1-change built property to run as admin (didn't work).
2- read/write registry data (didn't work).
change manifest .
this is my minifest :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="NationalInstruments.Installer.MetaInstaller" type="win32"></assemblyIdentity><description>MetaInstaller</description><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity></dependentAssembly></dependency><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS> </application> </compatibility></assembly>
as you see it's
<requestedExecutionLevel level="requireAdministrator"
but still the program doesn't ask run as admin .
what can i do ?
Best Regards
Solved! Go to Solution.
05-10-2015 09:02 AM
05-10-2015 09:24 AM
thanks for reply
"Where is the file at that you are trying to open?"
Drive C
Constant address "C:\PMsetting.bin"
" What kind of file?"
binary file
"What type of access are you requesting (read, write, read-write)?"
read and write
" What error are you getting from the open file function?"
no errore just doesn't work !
here is my vi
this vi is called from main vi
05-10-2015 09:42 AM
If you are getting a requirement to Run as Administrator, then Windows (or Linux, or whatever) is "messing with you". What I've done when I need to put files where "ordinary users" can access them is to place them in a Public Folder. On Windows 7, this is usually C:\Users\Public\Public Documents. Can you try this and see if it works? [I generally try to keep C: as "clean" as possible, and certainly keep my own files and folders off the root of C:].
Bob Schor
05-10-2015 09:43 AM
05-10-2015 09:46 AM
05-10-2015 10:03 AM
"C:\Users\Public\Public Documents"
good idea .change the destination and program works well .
thanks God it doesn't need to promote to admin access .
05-10-2015 10:10 AM
05-10-2015 10:11 AM
"1. Is the software written such that if an error occurred you'd know about it. What do you try to do after opening the file? How do you know it isn't working?"
No i don't show the error Shame on me !
Read data from file apply to control element (serial port setting) if user changed setting and connection is succesfull new setting is write in file .
05-10-2015 10:25 AM
How do you see my code ?
here is my sequence :
1-open file
2-check errore if error is equal to 7 means there is no file
3-creat file with default setting
4-wait for connection established
5-write new setting in file
Thanks