PDA

View Full Version : Where was my program installed last time?



NewsArchive
08-20-2007, 01:35 AM
I have a default path to both program and data.
That is prety often changed by the first installer, as it is often installed
first time by an IT pro.
On updates, the customers presses next - next.... and phones the hotline -
Where has my data gone to?
The solution is of cause to put the info in the registry (Where, how to) and
retrive them again on updates and put the values in as defaults.

Friederich has tried to tell me how once,. but I just could not get it to
work. Not his fault I believe, I am very unfamilar with the registry.

Somebody who has a working example?

Edvard Koirsbęk

NewsArchive
08-20-2007, 02:38 AM
Sorry for not having a working example, but I have done it in quite a few
installs now.
In the script editor, locate the Intialize setup section. Scroll down a
little, and you see where the %_SB_InstallDir%and %RegName% is primed.

Below this, you use the Get Registry KeyValue function.
Mine look like this, Software\companyname\productname

Set Variable %_SB_INSTALLDIR% to FUNCTION:Get Registry("InstallPath") from
"HKEY_CLASSES_ROOT\Software\AdiTech\%REGNAME%"

The variable and default value is set to %_SB_INSTALLDIR% so the default
value is used if the program has not been installed earlier.
Root = HKEY_CLASSES_ROOT
Key = Software\YourCompany\%REGNAME%
Value=InstallPath (or what you like to call it)

Then, in the section Edit Registry, you write the value of %_SB_InstallDir%
to registry using the Edit Registry function

Edit Registry (Create/update key and value)
"HKCR\Software\AdiTech\%REGNAME%" InstallPath

Root = HKEY_CLASSES_ROOT
Key = Software\YourCompany\%REGNAME%
Name = InstallPath
DataType = String
Data Value = %_SB_INSTALLDIR%

Bjarne Havnen