This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Feature Updates
 Completed Requests
 [COMPLETE] Read/Write Windows Registry Keys
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

breakcore

Russia
74 Posts

Posted - 11/01/2012 :  06:46:10  Show Profile
Currently I have registry involved actions done by autoit scripts which are running by S+ gestures. But this way is a little slow, so I'm thinking may be it's possible to implement those scripts right in the S+. Does lua script (or alien) capable of reading/writing the windows registry key values?


Edited by - breakcore on 11/01/2012 08:37:50

Rob

USA
2615 Posts

Posted - 11/01/2012 :  10:36:31  Show Profile  Visit Rob's Homepage
Actually, it's probably ok here since there are no actions which assist in reading/writing registry values.

I'll add that to my todo list..like:

acSetRegistryKey (update or create if doesn't exist)
acSetRegistryValue (update or create if doesn't exist)
acGetRegistryKey (not sure about this one, as far as returning a whole key..I'll think it through)
acGetRegistryValue (get a value)
Go to Top of Page

breakcore

Russia
74 Posts

Posted - 11/01/2012 :  10:54:55  Show Profile
This is great!!!
Go to Top of Page

breakcore

Russia
74 Posts

Posted - 11/01/2012 :  11:23:18  Show Profile
And while we on todo list, don't you think the script field font size is unreasonably big?
this forum, on the other hand, has a perfect code size
Go to Top of Page

Rob

USA
2615 Posts

Posted - 11/04/2012 :  14:06:55  Show Profile  Visit Rob's Homepage
Added some basic registry functions in 2.3.8.

acRegistryCreateKey
acRegistryDeleteKey (will not delete if subkeys exist)
acRegistryDeleteValue
acRegistryGetNumber
acRegistrySetNumber (stores as DWORD)
acRegistryGetString (supports REG_SZ and REG_EXPAND_SZ)
acRegistrySetString (supports REG_SZ and REG_EXPAND_SZ)

Note that you may encounter issues with these if you are not running S+ with administrator privileges or are running with conflicting platforms, such as 32-bit S+ and 64-bit Windows.

I realize there are some limitations, but I didn't want to go overboard; just wanted to get the basics in there. I'll revisit and further enhance in the future based on what people need or issues encountered.
Go to Top of Page

breakcore

Russia
74 Posts

Posted - 11/04/2012 :  15:11:06  Show Profile
I've been waiting for this, Thank you!
Go to Top of Page

Hard.Wired

84 Posts

Posted - 05/09/2019 :  07:48:11  Show Profile
I've been trying to get some registy values in Windows 10, but no joy... e.g.

qf_sRegistryWindowsVerson = acRegistryGetNumber(2, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "CurrentMajorVersionNumber", "0")

What am I missing?

Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/09/2019 :  08:20:36  Show Profile  Visit Rob's Homepage
Even if you're running the signed version, but not as Administrator, S+ won't have access to that registry key. Now, that's because the code class I brought into S+ attempts to open the registry key via RegOpenKeyEx passing KEY_ALL_ACCESS, so it fails.

In looking at the reg class, it does have read access calls, but on my function I'm first trying to set the key (open for access) before trying to read the values, that SetKey call uses the KEY_ALL_ACCESS, but it seems that check just shouldn't be there.

Back when I added this, I don't think I had all of the signed stuff going on, so I only ran as admin and pretty much assumed most people did, especially if they wanted to access system things. Not that it excuses this oversight, but at least serves to explain it :)

I tried to see if this could be done via alien call in Global Lua, but it seems rather complicated and I'm not sure how to make it work.

However, you can probably use this as a workaround, you will probably need to do a little parsing/cleaning of the string..but that should be pretty easy:
local version = acGetFileVersion(acExpandEnvironmentString("%windir%").."\\explorer.exe", nil, gsx, gsy) 
acMessageBox(version, "Windows Version")

Go to Top of Page

Hard.Wired

84 Posts

Posted - 05/09/2019 :  09:17:19  Show Profile
Thanks, I'll look into these possibilities.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000