Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 592543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:45:03+00:00 2026-05-13T15:45:03+00:00

I’ve seen the WebApplicationExtension element, but because it must be a child of WebApplication

  • 0

I’ve seen the WebApplicationExtension element, but because it must be a child of WebApplication, it appears to require the creation of a new WebApplication. I don’t want that.

I want to create the extension (or script map) on an existing website. On uninstall, the website should remain but the extension (script map entry) should be removed.

Anyone know how to do this in WIX?


If I get no good answers, I guess I will have to do it within script before InstallFinalize.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:45:03+00:00Added an answer on May 13, 2026 at 3:45 pm

    I couldn’t figure out a way to do this in WIX, so I resorted to a custom action. I had been writing all my custom actions in Javascript. I find Javascript to be easy to use and robust for that purpose, despite what others have said.

    But I could not find a way to add a scriptmap from Javascript, because the IIS metabase update requires the use of a VBArray datatype, which is supported in VBScript, but not in Javascript. Whoops.

    So, here is the code, in VBScript.

    Function AddExtension_CA()
    
        VBSLogMessage("AddExtension_CA() ENTRY")
        Dim iis
        Set iis = GetObject("winmgmts://localhost/root/MicrosoftIISv2")
    
        dim siteName
        siteName = Session.Property("WEBSITE_NAME")
    
        VBSLogMessage "website name(" & siteName & ")"
    
        If (siteName <> "") Then
            Dim idir, dll
            idir = Session.Property("INSTALLDIR")
            dll = idir & "\MyIsapiExtension.dll"
    
            Dim query
            If (siteName <> "W3SVC") Then
                query = "SELECT * FROM IIsWebServerSetting WHERE Name = '" & siteName & "'"
            Else
                query = "SELECT * FROM IIsWebServiceSetting"
            End If
    
            Set results = iis.ExecQuery(query)
            Dim newMaps()   '' dynamically-sized Array
    
            '' two passes
            For t = 0 to 1
                Dim c
                c=0
                For Each item in results
                    '' in pass 1, count them. 
                    '' in pass 2, copy them.
                    For i = 0 to Ubound(item.ScriptMaps)
                        If UCase(item.ScriptMaps(i).Extensions) <> ".IIRF" Then
                            If t = 1 Then
                                Set newMaps(c) = item.ScriptMaps(i)
                            End if
                            c = c+1
                        End If
                    Next
    
                    If t = 0 Then
                        ReDim Preserve newMaps(c)
                    Else
                        VBSLogMessage("setting new filter")
    
                        Set newMaps(c) = iis.get("ScriptMap").SpawnInstance_()
                        newMaps(c).Extensions = ".iirf"
                        newMaps(c).ScriptProcessor= dll
                        newMaps(c).Flags = "1"
                        newMaps(c).IncludedVerbs = "GET,POST"
                        item.ScriptMaps = newMaps
                        item.Put_()
                    End If
                Next
            Next
    
            VBSLogMessage("Allowing the DLL as an Extension")
    
            dim IIsWebServiceObj
            Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")
            IIsWebServiceObj.AddExtensionFile dll, True, "GroupId", True, "Description of the Extension"
            Set IIsWebServiceObj = Nothing
    
        End If
    
        Set iis = Nothing
    
        VBSLogMessage("AddExtension_CA() EXIT")
    
        AddExtension_CA = 1   ' MsiActionStatus.Ok
    
    End Function
    

    Here’s the WIX code:

    <Fragment>
        <CustomAction Id="CA.AddExtension"
                  BinaryKey="B.VBScript"
                  VBScriptCall="AddExtension_CA"
                  Execute="immediate"
                  Return="check" />
    
        ....
    

    See also:
    AddExtensionFile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.