Example #1
0
        PKGStatus CheckReq(PKGRunningPackageData Package)
        {
            using (RegistryKey r = Registry.LocalMachine.OpenSubKey(RegPath))
            {
                if (r == null)
                {
                    return(PKGStatus.Success);
                }
                string Current = Convert.ToString(r.GetValue(Package.PackageID.Replace("\\", ""), ""));
                Int64  CurrentV;
                if (Int64.TryParse(Current, out CurrentV) == false)
                {
                    //install it!
                    return(PKGStatus.Success);
                }

                if (Package.VersionID <= CurrentV)
                {
                    //no, not needed
                    return(PKGStatus.NotNeeded);
                }
            }

            //install it!
            return(PKGStatus.Success);
        }
Example #2
0
        public PKGStatus PreInstall(PKGRunningPackageData Package)
        {
            PKGStatus p = CheckReq(Package);

            if (p != PKGStatus.Success)
            {
                Package.ErrorText = "Not needed";
            }

            return(p);
        }
Example #3
0
        public PKGStatus PostInstall(PKGRunningPackageData Package)
        {
            using (RegistryKey r = Registry.LocalMachine.CreateSubKey(RegPath))
            {
                if (r != null)
                {
                    r.SetValue(Package.PackageID.Replace("\\", ""), Package.VersionID);
                }
            }

            Package.ErrorText = "";
            return(PKGStatus.Success);
        }
Example #4
0
        public PKGStatus CheckInstallationStatus(PKGRunningPackageData Package, PKGInstallState state)
        {
            State = state;
            Package.SetInstallPath(InstallPath);
            Package.ErrorText = "";

            PKGStatus p = CheckReq(Package);

            if (p != PKGStatus.Success)
            {
                Package.ErrorText = "Not needed";
            }

            return(p);
        }
Example #5
0
 public PKGStatus ApplyUserSettings(PKGRunningPackageData Package)
 {
     Package.ErrorText = "";
     return(PKGStatus.Success);
 }
Example #6
0
 public List <string> GetDependencies(PKGRunningPackageData Package)
 {
     return(new List <string>());
 }
Example #7
0
 public PKGStatus Rollback(PKGRunningPackageData Package)
 {
     Package.ErrorText = "";
     return(PKGStatus.Success);
 }