PDA

View Full Version : Updating Registry



NewsArchive
03-24-2010, 04:22 AM
SB7.2.2903 - I have an install that creates a new registry key, value and
data value where the data value is
%_SB_INSTALLDIR%\UPDATE. %_SB_INSTALLDIR% is correct in the 'Install Files'
section, the 'Create Shortcuts' section but when I get to the 'Edit
Registry' section, %_SB_INSTALLDIR% suddenly now has a trailing '\' which
messes the registry value. All of my files are being copied to the right
folder. The shortcut's start in is correct. My SetupBuilder Edit Registry
command is attached. Help!

Dee Witham

NewsArchive
03-24-2010, 04:24 AM
Maybe post a shot of what's in your script between the first wizard loop and
where you're editing the registry?

I just tried a simple vanilla install (attached), and the correct registry
key and value seem to be created ??

Jane

NewsArchive
03-24-2010, 04:25 AM
I have attached the script code. Dialog #3 (List Box) does not appear as
%TTG_FOLDERS% equals a 1. This script was working last week - all I did was
change a registry key name from PDSMED to PDSMED_BETA. Like I said in first
post averything is getting copied correctly and built correctly. I even run
programs after the registry is update using %_SB_INSTALLDIR% and they run.

Dee

NewsArchive
03-24-2010, 04:27 AM
Can you save the script as a script rather than as a text file (remove any
passwords first).
It's too hard to recreate otherwise.

Jane

NewsArchive
03-24-2010, 04:29 AM
Also - is the value being written with incorrect contents or to an incorrect
key?

If you display a message box just before writing the registry (as in my
sample script), is the information correct?

Jane Fleming

NewsArchive
03-24-2010, 04:30 AM
I have zipped my entire script but important part after loop wizard and
before edit registry. Yes, the value being written is correct (never
changed it) but I did change the key name. Yes, I did display a message box
right before edit registry and the trailing '\' was there. I displayed a
message box before create shortcuts and there was no trailing '\'.

Dee

NewsArchive
03-24-2010, 04:31 AM
Jane - I put a Handle String Function - RIGHT and then a message box with
the Destination Variable 1 and it is blank??? See attached screen shots.

Dee

NewsArchive
03-24-2010, 04:32 AM
Dee,
You need to specify how many characters you want that function to return
(pic)

Jane

NewsArchive
03-24-2010, 04:33 AM
Oops

Dee Witham

NewsArchive
03-24-2010, 04:34 AM
Well, obviously to get the script to compile I had to strip out the files
and just throw a few things from my machine into your structure.

But my message box before and after the shortcut creation does not have a
backslash.
But I still think I'm not understanding... you wrote "the value being
written is correct (never changed it"

Please spell out for an olde blonde exactly the name of the key and the
expected contents, and then what's actually being written / created instead.

Also... on a different matter... <<<<----
You are writing a bunch of Pervasive stuff to the registry.

I haven't worked with Pervasive... so maybe they have some tricks.
But normally, such writes will not work.
I can't create a new folder within HKLM when I use Regedit.
I can only create one within an existing folder, such as HKLM\SOFTWARE.

Try putting a message box to return %_SB_ERRORCODE% after one of those
registry writes you're attempting to HKLM\Pervasive Software. Is it, in
fact, being written?

Jane

NewsArchive
03-24-2010, 04:35 AM
Jane - I have attached 2 screen shots. #1 is how is was last week. #2 is
what I want it to be. I just right clicked and renamed the highlighted key.
I never touched the value name or data. Now I get the trailing '\'. The
Handle String command proves it. If I find a trailing '\' and issue the
Handle String Rslash command and everything is fine. As for the Pervasive
entries - they all exist now, all I am doing is changing the data value.
Dee

NewsArchive
03-24-2010, 04:51 AM
Jane - I attached screen shots of code and 3 message boxes. #1 message box
is before Create Shortcuts section, everything OK. #2 message box is before
Edit Registry section, everything wrong. #3 message box after Rslash
command, everything OK again. 4th attachement is SB code.

Dee

NewsArchive
03-24-2010, 04:52 AM
Dee,

> #1 message box is before Create Shortcuts section, everything OK.
> #2 message box is before Edit Registry section, everything wrong.

Hmm, but according to your screenshots, the value is D:\APPS\TTG\ in both
cases. Why is one OK and the other wrong?

%_SB_INSTALLDIR% should not have a trailing '\' at all. So IMO, it's
already wrong in the #1 message box (before Create Shortcuts section). It
should be D:\APPS\TTG

Friedrich

NewsArchive
03-24-2010, 08:13 AM
Friedrich - thanks for the catch. I guess I need new glasses. The create
shortcut command right after the first message box is creating the shortcut
correctly and it uses %_SB_INSTALLDIR%. I will continue to research.
Dee

NewsArchive
03-24-2010, 08:14 AM
Dee,

> Friedrich - thanks for the catch. I guess I need new glasses. The create
> shortcut command right after the first message box is creating the
> shortcut correctly and it uses %_SB_INSTALLDIR%. I will continue to
> research.

:)

Even if the Shortcut is created, it does not mean that the trailing '\' was
not already there.

What's the value of your %_SB_INSTALLDIR% value right after the first Wizard
Loop?

Friedrich

NewsArchive
03-25-2010, 02:05 AM
Friedrich - I have attached 2 screen shots. One for the %_SB_INSTALLDIR%
after the Wizard Loop and one with my Create Shortcut command. If
%_SB_INSTALLDIR% was bad before the Create Shortcut command, my Target: path
and Working Directory: path would be wrong since I append folders to the end
of %_SB_INSTALLDIR%.

Dee

NewsArchive
03-25-2010, 02:06 AM
Dee,

> Friedrich - I have attached 2 screen shots. One for the %_SB_INSTALLDIR%
> after the Wizard Loop and one with my Create Shortcut command. If
> %_SB_INSTALLDIR% was bad before the Create Shortcut command, my Target:
> path and Working Directory: path would be wrong since I append folders to
> the end of %_SB_INSTALLDIR%.

Yes, I agree. In this case your "Start In" Shortcut item would be
%_SB_INSTALLDIR%\. So %_SB_INSTALLDIR% is definitely correct after the Loop
Wizard and before the Create Shortcut function.

Please try the following. Start your setup.exe with the /E switch. This
will generate c:\sbevents.txt. Please send this file to support [at]
lindersoft [dot] com.

Friedrich

NewsArchive
03-25-2010, 02:06 AM
Friedrich - found it by viewing the sbevents.txt file but it is in the Call
DLL Function command. I have attached a screen shot of how I have it setup
and will email the sbevents file. Line 291 in the sbevents file. Thanks.

Dee

NewsArchive
03-25-2010, 02:07 AM
Dee,

> Friedrich - found it by viewing the sbevents.txt file but it is in the
> Call DLL Function command. I have attached a screen shot of how I have it
> setup and will email the sbevents file. Line 291 in the sbevents file.
> Thanks.

Yes, it's what I though. Your DLL changes the value of %_SB_INSTALLDIR%

Before your call to VALIDATESERIALNUMBER, %_SB_INSTALLDIR% is D:\APPS\TTG\.
After you called your DLL, %_SB_INSTALLDIR% is D:\APPS\TTG\.

Fix this in your DLL and you are done.

Does this help?

Friedrich

NewsArchive
03-25-2010, 02:08 AM
Should read:

"Before your call to VALIDATESERIALNUMBER, %_SB_INSTALLDIR% is D:\APPS\TTG.
After you called your DLL, %_SB_INSTALLDIR% is D:\APPS\TTG\"

Friedrich

NewsArchive
03-25-2010, 02:08 AM
Aha!
The old "my DLL changes the variable trick"! <g>

Jane Fleming

NewsArchive
03-25-2010, 02:08 AM
> Aha!
> The old "my DLL changes the variable trick"! <g>

YES <g> :)

Friedrich

NewsArchive
03-25-2010, 02:09 AM
OK - I agree with the DLL change. Questions: 1. How does me changing a
passed SB parameter in my DLL afffect SB? 2. Since %_SB_INSTALLDIR% is now
changed, how does the rest of my script run correctly (which it does)? I
load 3 exe's and update an ini file, using %_SB_INSTALLDIR% with no
problems.

Dee

NewsArchive
03-25-2010, 02:09 AM
Plus all programs and files being copied are copied correctly.

Dee

NewsArchive
03-25-2010, 02:09 AM
Dee,

> OK - I agree with the DLL change. Questions: 1. How does me changing a
> passed SB parameter in my DLL afffect SB?

Like it would affect any other program.

If you would call your DLL from, say, a Clarion or Visual Studio or whatever
application and you would set a variable TESTVAR = D:\APPS\TTG and call
VALIDATESERIALNUMBER(TESTVAR) in your DLL, then after your call, TESTVAR
would also be D:\APPS\TTG\ in your Clarion or Visual Studio app ;-) This
has nothing to do with SB. You pass a string pointer to the DLL!

BTW, this is what you see for a install file action in the debug log:

Install file: D:\APPS\TTG\\RTFtokens.exe

Please note the double "\\". But the CreateFile() Windows API forgives this
error here and does not fail.

Does this help?

Friedrich

NewsArchive
03-27-2010, 04:11 AM
Yes. Thanks.

Dee Witham