|
|
#1 |
|
Junior Member
Join Date: Aug 2014
Posts: 1
|
Admin authorization
Dear support,
we are using NSIS Installer 3.0b0 to install on a WIN8 (8.0 and 8.1) our application written in QT5 and a SQLite Database file. The Installer is planned to install all the files in the folder "C:\Program Files (x86)\Label\FarmManager NETWORK." Installer is set with Administrator privileges (RequestExecutionLevel admin). Our problem is that the first time the application is launched, the Applicationdatas folder (the one containing the DB and the Application Preferences) located in "C:\Program Files (x86) \Label\FarmManager NETWORK", is automatically copied by the OS in "C:\Users\LABEL\AppData\Local\VirtualStore\Program Files (x86)\Label\FarmManager NETWORK" (the AppData folder is a hidden folder type) and by this time the application will use always this last folder, ignoring the one installed with the Installer which is also present in the application folder. To us this thing we created several problems, even though we read that it is a way of functioning of WIN8 in order to protect the cancellation / change files accidentally. We have seen that if the executable has the box "Run this program as administrator" checked, the OS no longer creates a copy of the folder Applicationdatas and everything works properly. We have two questions please: It is possible to add commands to the installer to enable this option (i.e. to make the executable working with the privileges of administrator) during installation? It is possible to add a shortcut to the taskbar? Thanks a lot. Bye Virginio |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
You need to include a manifest in your application so that Windows does not apply the file redirection compatibility shim.
This probably only happens if your program tries to write to "C:\Program Files (x86) \Label\FarmManager NETWORK" which it should not do in the first place because it is bad practice and a possible security issue if you changed the ACL of this folder. Your application should write to CSIDL_APPDATA or CSIDL_LOCAL_APPDATA. Setting the run as administrator property is the wrong solution. You should fix your application. How annoying is it for your users to run something as administrator every time? What happens if a user starts your application from a different shortcut? Starts the .exe directly? Used "Open With" etc? If you want to do the wrong thing then you should have searched before asking, this has been discussed a million times before: http://nsis.sourceforge.net/IShellLink_Set_RunAs_flag http://nsis.sourceforge.net/ShellLin..._Administrator http://forums.winamp.com/showthread.php?t=278764 http://forums.winamp.com/showthread.php?t=319628 While it is possible to pin a shortcut to the taskbar I'm not going to tell you how because the user is supposed to be in control of their pinned items. See also: http://blogs.msdn.com/b/oldnewthing/.../03/54760.aspx IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|