02-17-2016 10:46 AM
Hello,
LV installer has selected "Run executable at end of installation".
If you run the installer "Run as Administrator", the executable runs with elevated rights?
Best Regards
Solved! Go to Solution.
02-17-2016 11:36 AM - edited 02-17-2016 11:36 AM
I haven't tested this but I'm almost certain it would not work that way. When you run an installer with elevated privileges that is limited to that executable being ran, which is the setup EXE. After that is installed running the EXE it installs shouldn't do anything different.
One possible work around is you can run an application, as if you were another user. There is the command line Run As, which I think can save credentials so you aren't prompted.
http://www.sevenforums.com/tutorials/419-run-different-user.html
Or there is another command line program that you provide the user name and password as plain text which can be a security issue.
https://technet.microsoft.com/en-us/sysinternals/psexec.aspx
Using either of these you can make a shortcut that runs your program as a different user.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-17-2016 05:11 PM
Starting from your links, I found this solution:
http://www.sevenforums.com/tutorials/316-compatibility-mode.html
1. Before running the .exe file, edit the registry:
-path: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ AppCompatFlags \ Layers
Name: "full path to the file .exe"
Data: "RUNASADMIN"
2. Run the .exe file using SystemExec.vi
3. After the .exe program, delete the registry value created (optional)
The only problem might be that modifying the registry key, 😞 require elevated privileges.
I have a lot of digging ...
BR
02-17-2016 11:33 PM
Embed a windows manifest file telling windows the executable needs elevated rights:
http://digital.ni.com/public.nsf/allkb/E06C1800F5AFCCBF86257236006C9F2A
02-18-2016 06:10 AM
02-18-2016 01:24 PM
I want to realize an installer for my software and I need to write some registry keys, to extract information about PC HW and OS and to set some .ini files. Another reason I want to do this installer is that the software contains several modules (.exe file). The user can select which modules are to be installed. Some modules require access to registry keys. For these reasons I have to make an installer and create solutions to access "as administrator" registry keys for different software modules.
I want to realize this installer to be launched after installing LVRT execution and run with elevated rights.
BR
02-18-2016 01:33 PM
02-18-2016 03:31 PM
I followed the instructions from the NI notice in order to extract .manifet file (see attachment) but the .manifest file has not appeared in the application directory.
I do not have the SDK installed. But I downloaded mt.exe file and copied to the folder Windows \ system32. Let this be the problem? I need to install the complete SDK?
BR
02-18-2016 05:46 PM
I managed to extract the manifest file from setup.exe (created with LV installer). The solution is:
C:> mt.exe -inputresource:"<full path>\<application>.exe" -out:"<full path>\<application>.manifest"
instead of
C:>mt.exe -inputresource:"<full path>\<application>.exe" -out:<application>.manifest
BR
02-19-2016 05:54 AM
Thank you.
The .exe file launched by the installer, "Run as Administrator".
Now I want to dig on the .manifest files.
I managed to extract a .manifest file from the installer (setup.exe). I tried to embed the .manifest file in my application and building went OK. When I launched my .exe file, Windows display the window to allow ... meaning that it try to "Run as Administrator". After my confirmation, Windows display an error and the file was not run. I rebuilt the application without manifest file and everything returned to normal.
Does anyone know how to create a simple .manifest file, that only allowing the running application "Run as Administrator"?
BR