static int Main(string[] args) { string topcmd = args[0].ToLower().Trim(); if (topcmd == "setwallpaper") { return(Core.SetWallpaper(args)); // Note: no GUI } // Windows Vista or later if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Check if the start up directory writable GlobalSetting.IsStartUpDirWritable = GlobalSetting.CheckStartUpDirWritable(); // Enable Portable mode as default if possible GlobalSetting.IsPortableMode = GlobalSetting.IsStartUpDirWritable; if (topcmd == "igupdate")// check for update { Core.CheckForUpdate(); } else if (topcmd == "igautoupdate")// auto check for update { Core.AutoUpdate(); } else if (topcmd == "firstlaunch") { Application.Run(new frmFirstLaunch()); } return(0); }