Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }