How do I access windows registry?

Get help using Construct 2

Post » Sun Feb 28, 2016 10:51 pm

I am pretty sure the answer is - "you can't" but I thought I would ask.

I want to export my app as an EXE for windows.

However, I need to send information to the application about progress etc and receive information back from the exe.

I was hoping to be able to read information out of Windows Registry to do this. i.e., read from the registry and later write information into the registry.

Has any one had a similar challenge, how did you solve it?
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Sun Feb 28, 2016 11:35 pm

In theory, this is not possible due to security restrictions: the browser should not be able to modify the local machine.

But node-winreg could help
Image Image
B
22
S
13
G
130
Posts: 869
Reputation: 67,816

Post » Mon Feb 29, 2016 12:25 am

@madspy

Cheers I will look into that. While at the gym I also thought about maybe talking to a windows app using GET and POST
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Mon Feb 29, 2016 12:30 am

Nw.js is able to launch another app( or bat file) .. depends on what you want to achieve exactly
Image Image
B
22
S
13
G
130
Posts: 869
Reputation: 67,816

Post » Mon Feb 29, 2016 12:46 am

Should be able to do it using pure text files in the same folder as the EXE.

https://www.scirra.com/manual/162/nwjs

"The NW.js object has the ability to read and write text files on disk. To support all possible languages, it always reads and writes with the UTF-8 encoding. To ensure the plugin reads your own text files correctly, ensure they are encoded as UTF-8."

Then using something like Visual Studio Express make a "watchdog" type app running in the background that will poll the file for changes from your C2 app and send information out online.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit
B
113
S
39
G
17
Posts: 2,184
Reputation: 19,217

Post » Mon Feb 29, 2016 6:16 am

The textfile idea sounds like a simple solution which will work well within the current framework - I will have a go
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Wed Mar 02, 2016 5:13 pm

You can do this with Java, but I am not sure this is a good idea. What are you writing to the registry for?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Wed Mar 02, 2016 7:00 pm

@gumshoe2029 i have gone with the text files system. Our software suite writes out the student's progress and current score into the text file. The c2 app reads that info. When the student closes the app their current progress is written back to a text which is then processed by the main application.
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Wed Mar 02, 2016 7:20 pm

That seems like a task that would be safer for a server to handle.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Thu Mar 03, 2016 3:40 am

@gumshoe2029 in this case it the app is part of a very large education suite of software that is 98% win32. The other application all use COM to communicate things like difficulty and option settings. So it has been a bit of a challenge to fit C2 applications into our current model.

I have implemented the solution and it works like a charm.
B
37
S
9
G
5
Posts: 437
Reputation: 6,094


Return to How do I....?

Who is online

Users browsing this forum: NN81, TsubaRu and 9 guests