Esempio n. 1
0
        /// <summary>
        /// Uninstall procedure
        /// </summary>

        #region Uninstall procedure

        public static void autodestroy(string command, string uniqueID)
        {
            try
            {
                // Registry key deletion

                using (RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true))
                {
                    if (key == null)
                    {
                    }
                    else
                    {
                        key.DeleteValue(Initialization.parametersFromBinary("registryKey"));
                    }
                }

                // Self delete the excutable and database

                string App      = Common.SetAndCheckDir("InstallationPath") + "\\" + Settings.thefraudexplorer_executableName();
                string Database = sqlFile();

                string batchFile = "@echo off" + Environment.NewLine +
                                   ":deleApp" + Environment.NewLine +
                                   "attrib -h -r -s " + App + Environment.NewLine +
                                   "powershell -command \"& { clc '" + App + "';}\"" + Environment.NewLine +
                                   "del \"" + App + "\"" + Environment.NewLine +
                                   "if Exist \"" + App + "\" GOTO dele" + Environment.NewLine +
                                   ":deleDB" + Environment.NewLine +
                                   "powershell -command \"& { clc '" + Database + "';}\"" + Environment.NewLine +
                                   "del \"" + Database + "\"" + Environment.NewLine +
                                   "if Exist \"" + Database + "\" GOTO deleDB" + Environment.NewLine +
                                   "del %0";

                StreamWriter SelfDltFile = new StreamWriter(Common.SetAndCheckDir("InstallationPath") + SelfDltFileName);
                SelfDltFile.Write(batchFile);
                SelfDltFile.Close();

                Process proc = new Process();
                proc.StartInfo.FileName        = Common.SetAndCheckDir("InstallationPath") + SelfDltFileName;
                proc.StartInfo.CreateNoWindow  = true;
                proc.StartInfo.WindowStyle     = ProcessWindowStyle.Hidden;
                proc.StartInfo.UseShellExecute = true;
                proc.Start();
                proc.PriorityClass = ProcessPriorityClass.Normal;

                // Inform that the command was received and executed

                Network.SendData("uninstalled!", command, uniqueID, 1);

                Environment.Exit(0);
            }
            catch {};
        }
Esempio n. 2
0
        // Get machine unique identification

        public static string UNIQUEGUID_VALUE()
        {
            return("_" + GetMachineGUID() + Initialization.parametersFromBinary(APOSTFIXFLAG));
        }
Esempio n. 3
0
        /// <summary>
        /// Application versioning and references
        /// </summary>

        #region Application versioning and references

        public static string thefraudexplorer_version()
        {
            return(Initialization.parametersFromBinary(HVERFLAG));
        }