You are trying to run code farm level code. Are you using an account that has farm level permissions?
You may need to look at this
SPSecurity.RunWithElevatedPrivileges[
^]
Solutions.Add returns an SPSolution, so there is no need for
SPSolution customSolution = SPFarm.Local.Solutions["DemoWSP10.wsp"];
You should also be using
SPUtility.GetGenericSetupPath[
^] rather than Server.MapPath