This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Get a list of all IIS websites from IIS
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 16, 2010
09:21 PM
Get a list of all IIS websites from IIS
Hi,
I am using InstallScript.
I am trying to give the Option to the user to Create New or Use an Existing website to install the web application to in IIS.
Create a new website - fine
Use an Existing website - i need to get the Name and the ID and populate a dropdown list.
I am trying to build a list of all IIS website names and ID numbers.
e.g.
'Default website' 0
'new website' 1
'new website2' 2
Has anyone done this with Installshield?
Thanks.
-Aaron
I am using InstallScript.
I am trying to give the Option to the user to Create New or Use an Existing website to install the web application to in IIS.
Create a new website - fine
Use an Existing website - i need to get the Name and the ID and populate a dropdown list.
I am trying to build a list of all IIS website names and ID numbers.
e.g.
'Default website' 0
'new website' 1
'new website2' 2
Has anyone done this with Installshield?
Thanks.
-Aaron
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2010
11:37 AM
Hi,
Please refer to this kb article --> http://kb.flexerasoftware.com/selfservice/viewContent.do?externalId=Q111053. It has a sample VB Script code to retrieve the list of websites.
Thanks,
Alpesh
Please refer to this kb article --> http://kb.flexerasoftware.com/selfservice/viewContent.do?externalId=Q111053. It has a sample VB Script code to retrieve the list of websites.
Thanks,
Alpesh
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2010
04:15 PM
Thanks for that Link Aplesh,
Is this the best way to run VB code from InstallScript?
FindFile(WINSYSDIR, "WScript.exe", sWScript);
if sWScript != '' then
LaunchAppAndWait(WINSYSDIR ^ "WScript.exe", SUPPORTDIR ^ "getIssWebsites.vbs", WAIT);
endif;
When i run the VB code:
Dim objViewDim objRecordDim objW3SVC, objIisWebSiteDim lngOrderSet objView = Session.Database.OpenView("select * from ComboBox")
' enumerate webservers on localhost and populate ComboBox tableSet objW3SVC = GetObject("IIS://localhost/W3SVC")lngOrder = 1
For Each objIisWebSite In objW3SVCIf objIisWebSite.Class = "IIsWebServer" Then If LCase(objIisWebSite.ServerComment) <> "administration web site" Then
' add site name to ComboBox table (which is used by our dialog ComboBox) Set objRecord = Session.Installer.CreateRecord(4) objRecord.StringData(1) = "WT1_IISWebSite" ' property name objRecord.IntegerData(2) = lngOrder ' order objRecord.StringData(3) = objIisWebSite.Name ' value objRecord.StringData(4) = objIisWebSite.ServerComment ' text
' now add the record to the table objView.Modify 7, objRecord ' (7 = msiViewModifyInsertTemporary) lngOrder = lngOrder + 1 End IfEnd If
NextobjView.Close
I get a error message:
Line: 1
Char: 16
Error: Expected end of statement
code: 800A0401
Any ideas?
Is this the best way to run VB code from InstallScript?
FindFile(WINSYSDIR, "WScript.exe", sWScript);
if sWScript != '' then
LaunchAppAndWait(WINSYSDIR ^ "WScript.exe", SUPPORTDIR ^ "getIssWebsites.vbs", WAIT);
endif;
When i run the VB code:
Dim objViewDim objRecordDim objW3SVC, objIisWebSiteDim lngOrderSet objView = Session.Database.OpenView("select * from ComboBox")
' enumerate webservers on localhost and populate ComboBox tableSet objW3SVC = GetObject("IIS://localhost/W3SVC")lngOrder = 1
For Each objIisWebSite In objW3SVCIf objIisWebSite.Class = "IIsWebServer" Then If LCase(objIisWebSite.ServerComment) <> "administration web site" Then
' add site name to ComboBox table (which is used by our dialog ComboBox) Set objRecord = Session.Installer.CreateRecord(4) objRecord.StringData(1) = "WT1_IISWebSite" ' property name objRecord.IntegerData(2) = lngOrder ' order objRecord.StringData(3) = objIisWebSite.Name ' value objRecord.StringData(4) = objIisWebSite.ServerComment ' text
' now add the record to the table objView.Modify 7, objRecord ' (7 = msiViewModifyInsertTemporary) lngOrder = lngOrder + 1 End IfEnd If
NextobjView.Close
I get a error message:
Line: 1
Char: 16
Error: Expected end of statement
code: 800A0401
Any ideas?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
01:48 PM
This will help if you are planning to implement it in a custom action through a DLL.
http://floatingant.blogspot.com/2010/03/listing-all-websites-installed.html
Just in :rolleyes: case..
http://floatingant.blogspot.com/2010/03/listing-all-websites-installed.html
Just in :rolleyes: case..
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
08:23 PM
Sorry?
Is there a way of calling this custom DLL instead of using VB Script?
Where can i find more info on doing this?
Is there a way of calling this custom DLL instead of using VB Script?
Where can i find more info on doing this?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
08:25 PM
Sorry?
Is there a way of calling this custom DLL instead of using VB Script?
Where can i find more info on doing this?
1. Do i just create a text file and rename it .dll?
2. how do i add it to installshield?
3. how do i call it?
Is there a way of calling this custom DLL instead of using VB Script?
Where can i find more info on doing this?
1. Do i just create a text file and rename it .dll?
2. how do i add it to installshield?
3. how do i call it?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
11:40 PM
Yes you can.
Readup "Calling a .dll File Function" article from Installshield Help.
Readup "Calling a .dll File Function" article from Installshield Help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2010
04:22 PM
Thanks for the help gprasadholla
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2010
04:31 PM
That DLL Dosnt have a function, Can i call it by going
UseDLL( SUPPORTDIR ^ "MyDLL.dll" );
bResult = MyDLL.MyFunction( nInt1, nInt2, nInt3 );
Can i call this DLL without it having a function?
System::String* entryName = System::String::Format(S"IIS://{0}/w3svc", computerName);
System::Text::StringBuilder* sb = new System::Text::StringBuilder(512);
System::DirectoryServices::DirectoryEntry* rootEntry = NULL;
System::DirectoryServices::DirectoryEntry* childEntry = NULL;
try
{
rootEntry = new System::DirectoryServices::DirectoryEntry(entryName);
rootEntry->RefreshCache();
System::Collections::IEnumerator* iterator = rootEntry->Children->GetEnumerator();
while(iterator->MoveNext())
{
childEntry = dynamic_cast<:DIRECTORYSERVICES::DIRECTORYENTRY>(iterator->Current);
if(!childEntry->Name->Equals( S"AppPools", System::StringComparison::CurrentCultureIgnoreCase ))
{
if(!childEntry->Name->Equals(S"Filters", System::StringComparison::CurrentCultureIgnoreCase))
{
if(!childEntry->Name->Equals(S"Info", System::StringComparison::CurrentCultureIgnoreCase))
{
//Print childEntry->Name;
}
}
}
}
}
UseDLL( SUPPORTDIR ^ "MyDLL.dll" );
bResult = MyDLL.MyFunction( nInt1, nInt2, nInt3 );
Can i call this DLL without it having a function?
System::String* entryName = System::String::Format(S"IIS://{0}/w3svc", computerName);
System::Text::StringBuilder* sb = new System::Text::StringBuilder(512);
System::DirectoryServices::DirectoryEntry* rootEntry = NULL;
System::DirectoryServices::DirectoryEntry* childEntry = NULL;
try
{
rootEntry = new System::DirectoryServices::DirectoryEntry(entryName);
rootEntry->RefreshCache();
System::Collections::IEnumerator* iterator = rootEntry->Children->GetEnumerator();
while(iterator->MoveNext())
{
childEntry = dynamic_cast<:DIRECTORYSERVICES::DIRECTORYENTRY>(iterator->Current);
if(!childEntry->Name->Equals( S"AppPools", System::StringComparison::CurrentCultureIgnoreCase ))
{
if(!childEntry->Name->Equals(S"Filters", System::StringComparison::CurrentCultureIgnoreCase))
{
if(!childEntry->Name->Equals(S"Info", System::StringComparison::CurrentCultureIgnoreCase))
{
//Print childEntry->Name;
}
}
}
}
}