public override void Install(IDictionary stateSaver) { base.Install(stateSaver); //String applicationPath = getAppPathFromRegistry(); if (Context.Parameters["TargetDir"] == null) { throw new Exception("Custom Data: TargetDir not set"); } String applicationPath = Context.Parameters["TargetDir"].Substring(0, Context.Parameters["TargetDir"].Length - 1); PrinterMonitorInstaller installer = new PrinterMonitorInstaller(applicationPath); try { installer.InstallAll(); } catch (Win32Exception ex) { throw new InstallException(ex.Message); } }
public override void Uninstall(IDictionary savedState) { if (Context.Parameters["TargetDir"] == null) { throw new Exception("Custom Data: TargetDir not set"); } String applicationPath = Context.Parameters["TargetDir"].Substring(0, Context.Parameters["TargetDir"].Length - 1); PrinterMonitorInstaller installer = new PrinterMonitorInstaller(applicationPath); try { installer.UninstallAll(); } catch (Win32Exception ex) { throw new InstallException(ex.Message); } base.Uninstall(savedState); }