Page 1 of 1
registry key not created
Posted: Tue Nov 28, 2006 10:06 am
by binkle
Hi,
I know it should work but the key I try to create is not created:
Code: Select all
Write Registry Key HKLM\\Software\\JAM Software\\ExchangeServerToolbox\\test, test
I set a breakpoint directly afte this code, open the registry explorer and see that the key "test" is not created.
I do have admin rights.
It's on all PC's I try the setup, the key is not created:
Any ideas why this may be?
Posted: Tue Nov 28, 2006 10:20 am
by binkle
Hi,
I tried another thing:
1. created a brand new project
2. inserted my "Write Registry Key" into the main install process, but before the progress dialog:
Code: Select all
Write Registry Key HKLM\\Software\\JAM Software\\ExchangeServerToolbox\\test, test
Display Dialog: progress, use as progress dialog (non-modal)
Comment: Modify Target System
3. set a breakpoint on the dialog line to see if the code is executed, it is.
BUT...
The value is NOT created.
P.S. I'm using version Studio 6.0 build gwinnet_sp2.090306
Posted: Tue Nov 28, 2006 10:53 am
by MichaelNesmith
Apply Install has to execute first...please read the help file topic titled "setup commands preceding apply uninstall" for a detailed explanation.
Posted: Wed Nov 29, 2006 2:52 am
by binkle
Hello Micheal,
this does not fix the problem.
I moved the code behind the apply install line:
Code: Select all
Comment: TO-DO: Insert any additional install commands here
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Apply Install (get result into variable SUCCESS)
end
[compiler end]
Write Registry Key HKLM\\Software\\JAM Software\\ExchangeServerToolbox\\test, test
Set Variable PROGRESS to 100
(in the fresh test project)
and in my software project it is already behind apply install:
Code: Select all
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Create Folder $TARGETDIR$\\bin
Create Folder $TARGETDIR$\\help
Apply Install (get result into variable SUCCESS)
Comment: TO-DO: Insert any additional install commands here
Set Variable ENCSERIAL to none
Write Registry Key HKLM\\Software\\JAM Software\\ExchangeServerToolbox\\test, test
Run .NET Installer Class $TARGETDIR$\\bin\\ExchangeServerToolbox.dll
Read Registry Key HKLM\\Software\\JAM Software\\ExchangeServerToolbox\\EncSerial into ENCSERIAL
In both cases aplly install is called, but the registry key is not created.
Any other ideas?
Posted: Wed Nov 29, 2006 8:50 am
by MichaelNesmith
Sorry for being obtuse. I meant to say that Apply Install has to execute before the key is created, as in, the moment Write Registry executes, it won't immediately create the key, and it will actually create it when Apply Install is called. And, in your examples therefore, it won't ever work, before Apply Install is not called at all after your Write Registry statement.
Think of all purple commands (Windows Installer commands with default syntax highlighting) in your script as being "cached" and not directly executing, with the cache being "flushed" the moment Apply Install is called. That should clarify things up a little.
For more details, you can read this:
www.installaware.com/msicode_scripting_technology.pdf
This whitepaper explains how InstallAware's MSIcode "magic" works under the hood in full detail.
Posted: Wed Nov 29, 2006 9:47 am
by binkle
AH, that's it!
I see. so I need only to decide to call "Apply install" again after using "Write Registry Key" or move the key creation before the first "Apply install".
That's fine.
Thank you very much!!
Posted: Wed Nov 29, 2006 12:01 pm
by MichaelNesmith
Yes. Multiple usage of Apply Install IS discouraged. Why? Because the entire "cache" will be flushed on each call of Apply Install - so its a slight performance hit. You can still do it if you want to, its just not the most elegant approach.
There is a plug-in that writes directly to the registry on the forum, so you can use that; OR just move the call above Apply Install.