View Full Version : How to...
NewsArchive
12-15-2005, 03:49 AM
I'm finally getting around to recreating an install in SB5 and I have the script
putting the [INSTALLDIR] in a registry key. What I don't know how to do is have
the install script retrieve that value, if present, and set the [INSTALLDIR] to
the registry key value. Is there an example that shows how to script this?
--
-- Ned --
Have you seen Rolling Stock?
www.sashasoft.com
NewsArchive
12-15-2005, 03:49 AM
Hi Ned,
Firstly if you have the Developer Edition then you can use the "Detect
Previous Version" function. This uses the GUID of your previously
installed product and returns the path.
Something like:
Set Variable %_SB_INSTALLDIR% to Detect Previous Version
("{43697610-2C6C-11D9-6784-006F6AE318BE}")
If %_SB_ERRORCODE% Equals "0" Then
Display Message Box "It aint there"
Exit Installation
End
Alternatively you can use the "Get Registry Key Value" function to
retrieve the path from your other registry entry and place it in the
%_SB_INSTALLDIR% variable.
Something like: (stolen from Friedrich's help file <g>)
Set Variable %PREVIOUSDIR% to GetReg("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
Best Regards,
Geoff Spillane
Data Down Under
NewsArchive
12-15-2005, 10:13 AM
> Firstly if you have the Developer Edition then you can use the "Detect
> Previous Version" function. This uses the GUID of your previously
> installed product and returns the path.
I have the Pro version. I'll try your second suggestion.
I really have to study the scripting features, but just haven't had the time.
Thanks much,
--
-- Ned --
Have you seen Rolling Stock?
www.sashasoft.com
NewsArchive
12-16-2005, 03:05 AM
I find that Friedrich has been pretty good in labeling the functions
appropriately so if you look for a function that might do what you
want chances are you'll find it. For example you wanted to retrieve
the value from the Registry. Friedrich called the function "Get
Registry Key Value". It pretty well says what you want to achieve. If
you are unsure if it is appropriate just double-click on it and when
the dialog box opens just press the F1 key on your keyboard to open
the help source on that specific function.
Best Regards,
Geoff Spillane
Data Down Under
NewsArchive
12-18-2005, 03:49 AM
> I find that Friedrich has been pretty good in labeling the functions
> appropriately so if you look for a function that might do what you
> want chances are you'll find it. For example you wanted to retrieve
> the value from the Registry. Friedrich called the function "Get
> Registry Key Value". It pretty well says what you want to achieve. If
> you are unsure if it is appropriate just double-click on it and when
> the dialog box opens just press the F1 key on your keyboard to open
> the help source on that specific function.
Your second suggestion got me on the right track and I did find everything I
needed in the help. It's working as I want now.
Thanks,
--
-- Ned --
Have you seen Rolling Stock?
www.sashasoft.com
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.