Page 1 of 1
Enumerate IIS / SQL Server instances
Posted: Wed Apr 19, 2006 8:55 am
by MarkRichards
Hello,
Is it possible with InstallAware to enumerate SQL Server (local and networked) and IIS (local only) service intances so that the installing user can select them?
If InstallAware doesn't support this directly, any recommendations on the best way to accomplish the goal?
Thanks!
- MR
Posted: Wed Apr 19, 2006 9:29 am
by jimo
Posted: Wed Apr 19, 2006 10:10 am
by MarkRichards
Thanks for the tip.
That looks like it would work for enumerating local SQL Server instances, but not remote ones.
Perhaps I'll need to look at doing such things outside of InstallAware?
Posted: Wed Apr 19, 2006 10:20 am
by jimo
You can create a plugin that enumerates ALL SQL Servers on a network.
If you do please make it available to the community, I know I would like to have this and I am sure many others would too.
Posted: Wed Apr 19, 2006 1:58 pm
by MichaelNesmith
We have an upcoming plug-in that enumerates both local and global SQL instances - contact me privately if you would like to receive a copy.
As for IIS, does the RegistryEx plug-in help?
Posted: Fri May 12, 2006 7:54 am
by MarkRichards
No, to the best of my knowledge you cannot enumerate IIS 6 websites via the registry. I think that may have been true for IIS 5 (?), but in IIS 6 these entries are contained within the metabase.
This is actually critical for my installation, and I'm really struggling to move forward with it using InstallAware. One idea I had would be to launch an EXE that enumerates IIS instances (using COM / Directory Services) and write what it finds to a registry key in HKLM. It would then terminate with a success error code and InstallAware could read the registry entries.
Unfortunately, I don't see a way to read the contents of an entire registry key, even with the RegistryEx plug-in. How can I use the "Parse String" function to tokenize a variable number of character-delimited entries?
If you know of any easier ways to do this, please let me know. So far it's turning out to be a lot more trouble than I was expecting (or at least hoping).
Posted: Fri May 12, 2006 3:28 pm
by MichaelNesmith
Here's an example code snippet. It reads every key under a registry key and displays the results in a message box.
Code: Select all
~InstallAware Clipboard Data~
~Comment~
~{04B8DAAA-AC10-4180-BAD9-564A2A631F29}~
~~
~MessageBox~
~{E8A98A2F-85A7-4FCC-8EA3-A185D1607790}~
~DISPLAYKEYS~
~$DISPLAYKEYS$~
~0~
~1~
~~
~Comment~
~{137ACA5F-8E92-4646-84CD-0CEC148CE6C4}~
~Display results~
~Comment~
~{B41F1CD8-0EB3-4EA7-9E4D-5C21DF013054}~
~~
~End~
~{71A5CD99-19A4-406E-A13B-B65B8EC394B6}~
~GoTo Label~
~{2F99BEAF-377F-4EFB-A7FD-1F9C9A8A3442}~
~Loop~
~If~
~{3C7B62BB-7960-44EF-9FB7-C4A904D31690}~
~REGISTRYEXVAR~
~0~
~~
~TRUE~
~Comment~
~{DA971845-FA23-4CA5-A5AE-EE78A096FAEC}~
~Loop until every item is parsed~
~Comment~
~{DDC5504A-E03C-4882-BAA7-0C26A0DF05A9}~
~~
~Set Variable~
~{990FE930-1F68-4540-9E66-48F6A00D471C}~
~DISPLAYKEYS~
~$DISPLAYKEYS$$PART1$$NEWLINE$~
~Comment~
~{38B4EBC2-234F-403B-9F20-B7BDA862E0EB}~
~Add parsed value to list, each item on its own line~
~Comment~
~{6D06F4C3-320C-40EE-936A-4515CBD92A31}~
~~
~End~
~{087F6400-1198-4B4A-8DA3-CF0C0BF40991}~
~End~
~{B5C237A2-7F95-4AFA-A0D1-96070A263D23}~
~Parse String~
~{87D516BD-8837-4991-AAAC-379067682796}~
~$PART1$~
~1~
~PART1~
~~
~3~
~FALSE~
~FALSE~
~Parse String~
~{2509AEB0-7932-4A75-8C9C-D7CD648874E5}~
~$PART1$~
~1~
~~
~PART1~
~2~
~FALSE~
~FALSE~
~If~
~{79FCEB25-A6B3-44B3-89C0-F4B4F72F4B57}~
~LASTCHAR~
~0~
~"~
~FALSE~
~If~
~{855C4D7A-0962-4BAF-95B4-B85AED09788A}~
~FIRSTCHAR~
~0~
~"~
~FALSE~
~Parse String~
~{5FB39A91-CAD2-4281-BF7A-36E330B74934}~
~$PART1$~
~1~
~~
~LASTCHAR~
~3~
~FALSE~
~FALSE~
~Parse String~
~{A5BC94E7-CB4A-40E7-A004-63E71711B795}~
~$PART1$~
~1~
~FIRSTCHAR~
~~
~2~
~FALSE~
~FALSE~
~Comment~
~{A36DA86B-2823-4161-BCF1-985B9B3069A4}~
~Get rid of leading and trailing quotes, if found~
~Comment~
~{C838137F-D39F-4E3C-A669-F1BA5D33EF95}~
~~
~Parse String~
~{765D389E-45E0-4D00-BBC5-177D6312F4D7}~
~$REGISTRYEXVAR$~
~@~
~PART1~
~REGISTRYEXVAR~
~0~
~FALSE~
~FALSE~
~Label~
~{4E692984-00D1-4EAD-8320-B7CB78611F35}~
~Loop~
~Set Variable~
~{EC57F51B-FC98-47D3-8BAC-421B367E0687}~
~DISPLAYKEYS~
~~
~Comment~
~{36BD8D12-EF4B-4EBE-BB2A-F69CEF98542C}~
~Store results in new variable~
~Comment~
~{AF56F20B-8D4D-433B-ABB5-D282510B6B1C}~
~~
~RegistryEx~
~{C287CCB8-90CC-467A-980E-6B2B8C1A1F9C}~
~HKEY_LOCAL_MACHINE,SOFTWARE,REGISTRYEXVAR,=,1~
~mIDE_RegistryEx.dll\\mEXE_RegistryEx.dll~
~Comment~
~{B5BF560B-AEC8-4557-999E-28C5BA9D8F7B}~
~Query all keys, keys are always delimited with the @ symbol~
~Comment~
~{FCEF98FA-217D-47DD-8FBB-2E934648D430}~
~~
~Set Variable~
~{BC820412-9948-4632-8CDA-9F9C7BD4A976}~
~REGISTRYEXVAR~
~~
~Comment~
~{4A43C11E-4087-4D27-A48A-6E3AD9BF9B61}~
~Declare variable for plug-in~
Hope that helps!
Posted: Fri May 12, 2006 3:29 pm
by MichaelNesmith
Below is the human readable form:
Code: Select all
Comment: Declare variable for plug-in
Set Variable REGISTRYEXVAR to
Comment: Query all keys, keys are always delimited with the @ symbol
RegistryEx : Read HKEY_LOCAL_MACHINE\\SOFTWARE into REGISTRYEXVAR
Comment: Store results in new variable
Set Variable DISPLAYKEYS to
label: Loop
Parse String $REGISTRYEXVAR$ into Variables PART1 and REGISTRYEXVAR (Split at first occurrence of pattern)
Comment: Get rid of leading and trailing quotes, if found
Parse String $PART1$ into Variables FIRSTCHAR and (Split at position from start)
Parse String $PART1$ into Variables and LASTCHAR (Split at position from end)
if Variable FIRSTCHAR Equals "
if Variable LASTCHAR Equals "
Parse String $PART1$ into Variables and PART1 (Split at position from start)
Parse String $PART1$ into Variables PART1 and (Split at position from end)
end
end
Comment: Add parsed value to list, each item on its own line
Set Variable DISPLAYKEYS to $DISPLAYKEYS$$PART1$$NEWLINE$
Comment: Loop until every item is parsed
if Variable REGISTRYEXVAR not Equals
GoTo Label: Loop
end
Comment: Display results
MessageBox: DISPLAYKEYS, $DISPLAYKEYS$