   registerConfigSchemaFromMetadata: ->
     if configSchema = @metadata.configSchema
       @config.setSchema @name, {type: 'object', properties: configSchema}
-      @configSchemaRegistered = true
+      true
+    else
+      false
 
   registerConfigSchemaFromMainModule: ->
-    return if @configSchemaRegistered
-
-    if @mainModule?
+    if @mainModule? and not @configSchemaRegisteredOnLoad
       if @mainModule.config? and typeof @mainModule.config is 'object'
         @config.setSchema @name, {type: 'object', properties: @mainModule.config}
-
-    @configSchemaRegistered = true
+        return true
+    false
 
   activateStylesheets: ->
     return if @stylesheetsActivated

        @loadMenus()
        @loadStylesheets()
        @loadDeserializers()
        @registerConfigSchemaFromMetadata()
        @settingsPromise = @loadSettings()
        if @shouldRequireMainModuleOnLoad() and not @mainModule?
          @requireMainModule()

    @activationPromise = null
    @resolveActivationPromise = null
    @activationCommandSubscriptions?.dispose()
    @configSchemaRegisteredOnActivate = false
    @deactivateResources()
    @deactivateKeymaps()
    if @mainActivated
