PDA

View Full Version : Hov to write and retrieve registry settings based upon variables.



NewsArchive
04-21-2007, 09:10 AM
This should be extremly simple, but i can't figure out how to.
The program is installed at %SB_INSTALLDIR%
Its data at %DATAFOLDER%
I want to set theese two variables to a registry key value if it exists.
That means, that I on the first installation should find that no reg keys
exists, and then create them.
On updates, the variables should be set to the registry keys values.
I get stuck allready when I try to write a variable to a registry key.
Someone who has done this, and could give a code example?

Best regards

Edvard Korsbæk

NewsArchive
04-21-2007, 09:10 AM
Edvard,

You only have to use the "Get Registry Key Value" script function.

For example:

Set Variable %PREVIOUSDIR% to ScriptItem->Get Registry("InstallationDir") from HKEY_LOCAL_MACHINE\Software\Linder Software\SetupBuilder 4.0

If %_SB_ERRORCODE% Not Equals "0" Then
Set Variable %_SB_INSTALLDIR% to %PREVIOUSDIR%
End

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-21-2007, 09:11 AM
By the way, to write registry values, use the "Registry Visualizer" or the
"Edit Registry" script function.

Friedrich

NewsArchive
04-23-2007, 10:37 AM
As i wote: 'It must be pretty simple....'

My vife is in Germany this week-end, whats your excuse for answering
saturday at 17:00 hours?

THANKS!

Edvard Korsbæk

NewsArchive
04-23-2007, 10:37 AM
My daughter Emily is growning and growing and I need the money <g>.

Friedrich