We have Maschke’s theorem stated in the following form (I am working over a field $k$ of characteristic $0$):
Theorem. Let $G$ be a finite group (or a compact Lie group), and let $V$ be a (possibly infinite-dimensional) $G$-representation. Then for every $G$-invariant subspace $W \subseteq V$, there exists a $G$-invariant complement $U$, i.e. $V = W \oplus U$.
My aim is to prove further that every such $G$-representation is completely reducible in the sense that there exists a collection $\{V_i\}_{i \in I}$ of irreducible subrepresentations of $V$ such that $V = \bigoplus_{i \in I} V_i$. For finite-dimensional representations, one can use induction on $\dim V$, but this approach does not work for infinite-dimensional representations.
For a finite group $G$, we can construct its group algebra $k[G]$ and then use module theory, since $V$ becomes a $k[G]$-module. In module theory, it is known that a module $M$ is completely reducible (in my sense) if and only if every submodule of $M$ has a complement in $M$.
My question is: can I do something similar if $G$ is a compact Lie group? Do I have to consider $U(\mathfrak{g})$, the universal enveloping algebra of the Lie algebra of $G$?