PDA

View Full Version : Windows Registry Runtime Variable Entry - (small jpg attached)



NewsArchive
12-12-2007, 02:45 AM
Hi All,

I am attempting to collect information at "runtime" from the users computer,
place it into a variable (%_SB_PARAM2%) and under certain conditions modify
an entry in the windows registry with the contents of the above variable.
(see attached image)

The "Edit Registry" function works, however, it is placing %_SB_PARAM2% into
the registry rather than the contents of the variable. According to the help
the content of the variable is resolved at compile time.

If this won't work is there an alternative I have overlooked?

Thanks a bunch.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
12-12-2007, 02:46 AM
Lee,

Just tested it here and it works fine.

The following writes the value data "test" to the value name "lee" under
"HKLM\software\test"

Set Variable %_SB_PARAM2% to "test"
Edit Registry (Create/update key and value) "HKLM\software\test" lee

So I assume that it's something in your script. If you are interested, send
your project to support (at) lindersoft (dot) com and we'll check it for
you.

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
12-13-2007, 03:18 AM
Hi Friedrich,

If I set the value in the script, compile and run it works as you describe.

What I am attempting to do is populate the variable (%_SB_PARAM2%) at
"runtime" from a source on the customers computer. Based on the value
received I then decide whether to make the registry adjustment or not. When
I try this "%_SB_PARAM2%" is written to the registry, NOT the contents of
the variable. Attached is a screen shot of the function setup. I am doing
this near the very end of the script.

This is not an actual install script. I am attempting to use SB to build a
utility to fix a potential registry problem on the customers computer. I
certainly don't want them mucking about in the registry.

Thanks for the help.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
12-13-2007, 03:19 AM
Hi Lee,

Just send a small demo script or something that reproduces the problem and
I'll check it. Unfortunately, your screenshot does not help. What do you
do to set the value for %_SB_PARAM2%?

BTW, the following *IS* populated at runtime, not compile time!

>
> Set Variable %_SB_PARAM2% to "test"
>

Friedrich

NewsArchive
12-13-2007, 03:20 AM
Hi Friedrich,

It seems SB may have a mind of its own when writing to the particular
registry key. Please see the attached image for a description of my
findings.

Any thoughts?

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
12-13-2007, 03:21 AM
Hi Lee,

Sorry, but that screenshot really does not help :) And it does not have
anything to do with the registry function in SB. It all depends on the
value of %_SB_PARAM2% For example, let us assume that (for whatever
reason), the value of %_SB_PARAM2% is set to %%_SB_PARAM2%%. In this case
we would exactly get what we see in your case.

I don't think that it is caused by a SetupBuilder bug (yeah, of course <g>).
Very simple to check. Before you write to the registry, display the value
via "Display Message Box" and let me know what you see.

Or better, let me know what you do to set %_SB_PARAM2% (or send me the
script). Perhaps this gives us more information. If there would be such a
bug in SetupBuilder then our Support Dept. already had a very big problem.

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
12-13-2007, 03:21 AM
Hi Lee,

Aha, I see. I did not see the whole screenshot.

What you are doing is incorrect. You set the [PRODUCTVER] compiler variable
(only available at compile-time) to the %_SB_PARAM2% runtime variable (only
available at run-time!!!). This is not possible!

See documentation for [PRODUCTVER]:

"[PRODUCTVER]-Enter the complete product version for this product. The setup
registers the major and minor version numbers as required by Windows logo
guidelines. The brackets [] denote that the item contained within the
brackets is a compiler variable. Runtime variables, such %TEST%, are not
permitted."

Does this help?

Friedrich

NewsArchive
12-13-2007, 03:22 AM
By the way, just let me know what you would like to do and I'll help.

Friedrich

NewsArchive
12-13-2007, 03:23 AM
Hi Friedrich,

I'm not certain I am being clear here. This is a very specific set of
circumstances. Please see the attached for a better explanation of the
problem.

Thanks for your help.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
12-13-2007, 03:25 AM
Hi Lee,

> I'm not certain I am being clear here. This is a very specific set of
> circumstances. Please see the attached for a better explanation of the
> problem.
>
> Thanks for your help.

I really don't know what you are trying to do <g>. Why don't you post your
full script? I thought you would like to update LOCAL_VERSION on the target
machine. That is only one line of source code (see "Update Client Version
Number..." script function).

First of all, your screenshot tells me that you are modifying the following
registry key:

Software\Lindersoft\WebUpdate\{577BD6D0-7EE1-11D9-6784-0001E0E518Be}

Okay. I have absolutely no idea what the above key is and why you modify
this key, but it is **not** a "Web Update" registry key.

The following would be a valid Web Update key (please note the extra "Apps"
key)

Software\Lindersoft\WebUpdate\Apps\{577BD6D0-7EE1-11D9-6784-0001E0E518Be}

I have attached my test script (includes the extra "Apps"). It works
absolutely perfect here on *ALL* machines. [PRODUCTVER] is 99.99.99.99 and
the tool sets the LOCAL_VERSION value to 6.6.6.6. See Lee1.gif.

And I have absolutely no idea why you don't use the "Update Client Version"
script function. The following would set the LOCAL_VERSION for your GUID to
7.7.7.7 (see Lee2.gif).

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
12-13-2007, 03:35 AM
Hi Lee,

You can use the "Update Client Version Number..." script function (under the
"Web Functions" list) to do what you want ;-)

Does this help?

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
12-13-2007, 03:40 AM
Hi Lee,

Just for fun, I tried the following:

Set Variable %_SB_PARAM2% to FUNCTION:Get System Information(User Name)
Edit Registry (Create/update key and value) "HKLM\software\test\lee" myvalue

It reads (at runtime) the Windows User Name and stores the value in the
%_SB_PARAM2% variable. Then it writes it to the registry. It works without
any problem (see attached screenshots).

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
12-23-2007, 01:09 PM
Hi Friedrich,

I apologize for the late reply to your last response. I was out of town for
a couple of days and unable to access my Email.

I was getting unexpected results in the registry and after a more careful
examination, I discovered it was driver error ( what a surprise....<g> ). I
am well on my way to accomplishing my objective now and I apologize for
taking up so much of your valuable time.

FWIW.... One of my pet peeves in any software is the inability to "easily"
move my program and data to a new computer without having to do a new
install and then possibly jumping through multiple hoops to get it working
like it was on the previous machine.

A feature I have built into my program is to perform a "Full" backup (using
Linder tools of course) which includes all program and data files and
creates a self extracting executable that is then copied onto portable media
of some sort.

My customer can then take that file to any computer running a Windows
operating system, run the EXE file and totally re-construct their program
and data, in its entirety on the new computer.

I use Armadillo and the program has the intelligence built into it to
remember the customers registration name and key and offer the option to the
customer to actually register it on the new computer or let in run in
"Trial" mode.

The only thing missing was creating the shortcuts, informing Windows for
"Uninstall" purposes and re-constructing the web update, and other
information in the Windows registry. This is where SB comes in.

I let SB read the version number from the customers "program.exe" file and
then use that information to let SB do all the dirty work. I have it working
now and it works a treat.

There is so much power in SB that often I find I can't see the forest for
the trees. I am just thankful you are so attentive and responsive to your
users needs. This kind of service is unheard of. Your product, and support,
set the standard that everyone should set as their objective.

Sorry... didn't mean to ramble on.

Merry Christmas and a Happy, Prosperous New Year

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
12-23-2007, 01:10 PM
Hi Lee,

Thanks so much for your kind words and for sharing this information :) Very
interesting! I am glad that it is working now.

Always let us know if there is a problem - I am here to help.

A Merry Christmas and a Happy New Year to you!

Friedrich