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:
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
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:
[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.
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.
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".
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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/