You are here

Registry problems...

9 posts / 0 new
Last post
otbsupport
Offline
Last seen: 16 years 4 months ago
Joined: 2006-05-23 16:25
Registry problems...

Greetings all... I'm working on building a portable app launcher for the shareware version of WinImage just as a practice app to help me learn a bit... It works fine, but when I put my registration information in, it looses it when the app shuts down. Seems like it's not properly backing up the registry although the code looks fine to me...

Registry::_RestoreKey "$SETTINGSDIRECTORY\settings.reg" .R0
ExecWait $EXECSTRING
Registry::_SaveKey "HKEY_CURRENT_USER\Software\WinImage"
"$SETTINGSDIRECTORY\settings.reg" "/G=1 /D=0 /B=0" .R0
Registry::_DeleteKey "HKEY_CURRENT_USER\Software\WinImage" .R0

...and the lines in question from the .reg file...

"NameRegistered"=""
"CodeRegistered"=""

if you view the registry after registering WinImage, it shows up with the correct registry entries, but they're gone on the backup after closing it...

Deuce
Offline
Last seen: 13 years 5 months ago
Developer
Joined: 2005-12-24 16:32
...

I don't see a problem, But I may need to see the whole code to see if it might be located at another place. However, When i wrote the Quickport Template, I wrote the Registry Plugin's code as such (With your locations subbed in):

${Registry::RestoreKey} "$SETTINGSDIRECTORY\settings.reg" $R0
${registry::SaveKey} "HKEY_CURRENT_USER\Software\WinImage" "$SETTINGSDIRECTORY\settings.reg" "/G=1" $R0
${registry::DeleteKey} "HKEY_CURRENT_USER\Software\WinImage" $R0

1st, try the formatting changes above, I seem to remember when i first started using the registry plugin, it had a small temper about have the "${...}" around the command and the "$" before the R0. This might not be the case here though.

2nd, if that doesn't work, and if you don't mind, send me the code at jwdurant(at)gmail(dot)com. I will look at it and see if I see anything.

Just FYI, I had this working a while ago, and had no problem with it. I did use my Quickport template to do it, maybe you could take a look at that code and see if there is something there,

I know you are trying to learn, so I want you to write this yourself, If you would like me to look at the code, send me an email. I hope I helped or can help.

***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.

Deuce
Portable Software: Just the beginning.

otbsupport
Offline
Last seen: 16 years 4 months ago
Joined: 2006-05-23 16:25
oops...

now that i've sent you the code in question, I realized that I won't be able to access that account tomorrow... if you have time to reply please send it to daniel(dot)j(dot)griffiths(at)usmc(dot)mil

sorry... missed a letter in the addy...

otbsupport
Offline
Last seen: 16 years 4 months ago
Joined: 2006-05-23 16:25
Hmmm...

Well, I tried both your suggestions here and in your email but I'm still having the same problem... any other ideas?

Deuce
Offline
Last seen: 13 years 5 months ago
Developer
Joined: 2005-12-24 16:32
Solution

Well, this is what I find and it works now. Turns out that winimage is starting too fast. Basically, we are asking the program to restore the settings to the registry and then start winimage. Which it is doing, it kicks off the restore and then imediately goes to the command to run winimage, but in the few seconds in between, the restore is still in progress when Winimage is checking the registry for the settings, so it does not see the registration info, hence starting the prog with blank info, regardless if the restore completed or not.

The solution is to add the following line after the registry::restore line:

"Sleep 500"

This will give the restore command sufficient time to complete the restore and then start winimage, winimage will see the settings and run registered.

***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.

Deuce
Portable Software: Just the beginning.

otbsupport
Offline
Last seen: 16 years 4 months ago
Joined: 2006-05-23 16:25
Thanks for the help Deuce,

Thanks for the help Deuce, works like a charm.

Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 5 years 6 months ago
Joined: 2006-02-18 18:06
Launcher?

Does this mean we are going to see the launcher posted? Let RMcue or myself know & we can host it.

~Lurk~

~Lurk~

otbsupport
Offline
Last seen: 16 years 4 months ago
Joined: 2006-05-23 16:25
Launcher...

It will be hosted on my server in a few days after I tweak a few things (both in the launcher and in my server Wink I will be looking for beta testers here and if John wants to post it here he is more than willing to... HOWEVER... due to the fact that WinImage is not OpenSource or freeware but SHAREWARE I will probably not be including the actual program with the launcher distribution file (I have to read up on their terms of use to see if they will allow redistribution in this way). If they don't allow it, you will just have to download the launcher and the WinImage installer, install/extract the program and copy the program folder over. The launcher does allow registration of WinImage, so if you have a valid license key it can be registered and the registration will be portable as well, otherwise it works fine in shareware mode...

Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 5 years 6 months ago
Joined: 2006-02-18 18:06
Understood

That is the reason I asked only about the launcher. Can't wait to try it out!

~Lurk~

~Lurk~

Topic locked