DonChunior Posted March 29, 2023 Share Posted March 29, 2023 In our company it is common for security reasons that normal user accounts do not have local admin rights on computers. But this causes an issue during the installation of SciTE4AutoIt: If you start the installer, the UAC window opens and you have to enter the login credentials of an admin account. After the installation is finished, the environment variable SCITE_USERHOME is missing for the normal user account and the data of the environment variable is located under %LOCALAPPDATA% of the admin account. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 (edited) 12 minutes ago, DonChunior said: After the installation is finished, the environment variable SCITE_USERHOME is missing for the normal user account and the data of the environment variable is located under %LOCALAPPDATA% of the admin account. Correct, so what exactly is the question? Without Admin rights, one isn't allowed to install programs in the c:\program files(x86) directory! When the question is that you are installing it with a different account, then all you need to do is add the appropriate SCITE_USERHOME environment variable to that users environment and copy the files for the userdirectory you installed with. Any case: You can run the setup in a portable mode which will function nicely! Just use the ZIP file and unzip it in any directory you have the rights for. Edited March 29, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DonChunior Posted March 29, 2023 Author Share Posted March 29, 2023 15 minutes ago, Jos said: Correct, so what exactly is the question? Without Admin rights, one isn't allowed to install programs in the c:\program files(x86) directory! The user with the normal user account can of course start the editor after the installation, but it does not work, for example, that the editor remembers which files/tabs were open in the last session. One always starts again with an "empty" editor. And this is probably a consequence of the fact that the files of SCITE_USERHOME are located under the administartive account. I have not encountered this problem with installers of other applications. Usually everything is prepared in such a way that all functionalities are also available for the normal user account and you do not have to run the application as admin. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 3 minutes ago, DonChunior said: I have not encountered this problem with installers of other applications. I have chosen for this installer to only installs SciTE4AutoIt3 for the current defined user as it copies files into the specific user's %localappdata% directory and sets an Environment variable for the user only. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DonChunior Posted March 29, 2023 Author Share Posted March 29, 2023 Do you have an improvement planned for this in a future release? 🤔 For example, so that the files and the environment variable are also (additionally) created for the user who initiated the launch of the installer? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 Just now, DonChunior said: For example, so that the files and the environment variable are also (additionally) created for the user who initiated the launch of the installer? Haven't checked yet, but Is that even possible with NSIS? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DonChunior Posted March 29, 2023 Author Share Posted March 29, 2023 I am not familiar with NSIS. I would have to read up on it first. But many installers ask if you want to install the application only for the current user or for all users. That can be realized with NSIS too, I think. And if you then select "all", the user independent data could be stored under the path of the environment variable PROGRAMDATA. User-specific data, such as the session file are then to be handled at runtime in the LOCALAPPDATA directory. Link to comment Share on other sites More sharing options...
argumentum Posted March 29, 2023 Share Posted March 29, 2023 ...it'd have to do with SciTE checking if the user has the folder structure and otherwise create it for the user. I guess a LUA can do that on SciTE load. Just an idea. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted March 29, 2023 Share Posted March 29, 2023 58 minutes ago, DonChunior said: the user independent data could be stored under the path of the environment variable PROGRAMDATA. Are you the only user or is it independent users ?. If is only you testing as Admin or User levels, the portable setup is the best approach. But the PROGRAMDATA folder would not work for concurrent or independent users. Then again, you can code an AU3 that on user logon do anything you need. But yeah, knowing your use case would aid in brainstorming a solution. ( not that I can brainstorm or anything ) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 (edited) What is in this case the directory structure and content of the %localuserdata%\autoit v3 directory? In other words: is only the environment variable missing or also the basic files for SciTE? Edited March 29, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DonChunior Posted March 29, 2023 Author Share Posted March 29, 2023 39 minutes ago, argumentum said: Are you the only user or is it independent users ?. If is only you testing as Admin or User levels, the portable setup is the best approach. But the PROGRAMDATA folder would not work for concurrent or independent users. Then again, you can code an AU3 that on user logon do anything you need. But yeah, knowing your use case would aid in brainstorming a solution. ( not that I can brainstorm or anything ) My use case is that only I am working on the computer with SciTE4AutoIt3, but the installation has to be done with an admin account as described before. argumentum 1 Link to comment Share on other sites More sharing options...
DonChunior Posted March 29, 2023 Author Share Posted March 29, 2023 34 minutes ago, Jos said: What is in this case the directory structure and content of the %localuserdata%\autoit v3 directory? In other words: is only the environment variable missing or also the basic files for SciTE? Also the basic files for SciTE are missing. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 Ok... I have tested a bit in VM and see indeed in the install.log that the Admin user is used as target for the %localappdata% files and Registry settings. Next question to answer: How can I get the original UserId in this situation so I can use that in the NSIS script.... needs some investigation. DonChunior 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 (edited) I think I can adapt the section in SciTEConfig.au3, which is ran at the end of the install process to finalize some things. I added some extra code which scans through the parent processes and when a different name is found, it will copy the %LOCALAPPDATA% from the Installer UserName to the Parent UserName directory and also update the "HKEY_USERS\SID\Environment" key "SCITE_USERHOME". So all should be good after the Environment load is forced (Kill Explorer or LogOff/LogOn) Still need to do some testing with the actual installer but running the script itself elevated with an different admin account seems to work fine. Edited March 29, 2023 by Jos DonChunior 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 29, 2023 Developers Share Posted March 29, 2023 (edited) I have updated the current production installer with the newer version of SciTEConfig.au3 which will do these steps when there is a different Username in the parent process tree: Copy %LOCALAPPDATA%\AutoIt v3 directory from the Admin username to the original user. Update the "HKEY_USERS\SID\Environment" key "SCITE_USERHOME" for the SID of the original Username. The Environment is also updated so it should work without a restart of Explorer or Logout&Login Additional install_user.log will be generated in the SciTE directory with info about the above. Update Tidy to avoid the initial SciTEConsole Debug messages hanging it for a while. Please give that a try to see if that works and let me know, so I can implement this for the next release. Jos Edited March 29, 2023 by Jos DonChunior 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DonChunior Posted March 30, 2023 Author Share Posted March 30, 2023 12 hours ago, Jos said: I have updated the current production installer with the newer version of SciTEConfig.au3 which will do these steps when there is a different Username in the parent process tree: Copy %LOCALAPPDATA%\AutoIt v3 directory from the Admin username to the original user. Update the "HKEY_USERS\SID\Environment" key "SCITE_USERHOME" for the SID of the original Username. The Environment is also updated so it should work without a restart of Explorer or Logout&Login Additional install_user.log will be generated in the SciTE directory with info about the above. Update Tidy to avoid the initial SciTEConsole Debug messages hanging it for a while. Please give that a try to see if that works and let me know, so I can implement this for the next release. Jos I can confirm that points 1 to 4 are working properly. Thank you for the quick solution to my problem. I can't say anything about point 5 because I don't understand what is meant by it. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 30, 2023 Developers Share Posted March 30, 2023 Thanks for testing 1-4! 5 was just an one-time issue When Tidy was run the first time after update, which was reported several times but only fixed in the available ZIP and Beta versions. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now