diff --git a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
index 63ab79d..8e334ec 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
@@ -152,7 +152,7 @@
 
         if (sm != null)
         {
-            result = m_felix.installBundle(location, is);
+            result = m_felix.installBundle(m_bundle, location, is);
             // Do check the bundle again in case that is was installed
             // already.
             ((SecurityManager) sm).checkPermission(
@@ -160,7 +160,7 @@
         }
         else
         {
-            result = m_felix.installBundle(location, is);
+            result = m_felix.installBundle(m_bundle, location, is);
         }
 
         return result;
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 7dfb4ae..8d5407e 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -734,7 +734,8 @@
                         {
                             // Install the cached bundle.
                             installBundle(
-                                archives[i].getId(), archives[i].getLocation(), archives[i], null);
+                                this, archives[i].getId(), archives[i].getLocation(),
+                                archives[i], null);
                         }
                     }
                     catch (Exception ex)
@@ -2615,13 +2616,15 @@
         return (val == null) ? System.getProperty(key) : val;
     }
 
-    Bundle installBundle(String location, InputStream is)
+    Bundle installBundle(
+        Bundle origin, String location, InputStream is)
         throws BundleException
     {
-        return installBundle(-1, location, null, is);
+        return installBundle(origin, -1, location, null, is);
     }
 
-    private Bundle installBundle(long id, String location, BundleArchive ba, InputStream is)
+    private Bundle installBundle(
+        Bundle origin, long id, String location, BundleArchive ba, InputStream is)
         throws BundleException
     {
         BundleImpl bundle = null;
@@ -2825,7 +2828,7 @@
         }
 
         // Fire bundle event.
-        fireBundleEvent(BundleEvent.INSTALLED, bundle);
+        fireBundleEvent(BundleEvent.INSTALLED, bundle, origin);
 
         // Return new bundle.
         return bundle;
@@ -4157,6 +4160,11 @@
         m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle));
     }
 
+    void fireBundleEvent(int type, Bundle bundle, Bundle origin)
+    {
+        m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle, origin));
+    }
+
     /**
      * Fires service events.
      *
