static void Msi_Load(SetupEventArgs e) { if (e.IsInstalling) { MessageBox.Show(e.ToString(), "Load"); } }
static void Msi_Load(SetupEventArgs e) { if (!e.IsUISupressed && !e.IsUninstalling) { MessageBox.Show(e.ToString(), "Load"); } }
static void Msi_AfterInstall(SetupEventArgs e) { if (!e.IsUISupressed && !e.IsUninstalling) { MessageBox.Show(e.ToString(), "AfterExecute"); } }
static void Msi_BeforeInstall(SetupEventArgs e) { if (e.IsInstalling) { MessageBox.Show(e.ToString(), "BeforeInstall"); } }
static void Msi_BeforeInstall(SetupEventArgs e) { if (!e.IsUISupressed && !e.IsUninstalling) { MessageBox.Show(e.ToString(), "BeforeInstall"); } }
static void project_Load(SetupEventArgs e) { try { SetEnvVErsion(e.Session); if (string.IsNullOrEmpty(e.Session["INSTALLDIR"])) //installdir is not set yet { string installDirProperty = e.Session.Property("WixSharp_UI_INSTALLDIR"); string defaultinstallDir = e.Session.GetDirectoryPath(installDirProperty); e.Session["INSTALLDIR"] = System.IO.Path.Combine(defaultinstallDir, Environment.UserName); } } catch { } MessageBox.Show(e.ToString(), "Load " + e.Session["EnvVersion"]); }
static void project_Load(SetupEventArgs e) { var msi = e.MsiFile; SetEnvVersion(e.Session); //MSI doesn't preserve any e.Session properties if they are accessed from deferred actions (e.g. project_AfterInstall) //Wix# forces some of the properties to be persisted (via CustomActionData) by using user defined //project.DefaultDeferredProperties ("INSTALLDIR,UILevel" by default). //Alternatively you can save any data to the Wix# specific fully persisted data properties "bag" SetupEventArgs.Data. //SetupEventArgs.Data values can be set and accesses at any time from any custom action including deferred one. var conn = @"Data Source=.\SQLEXPRESS;Initial Catalog=RequestManagement;Integrated Security=SSPI"; e.Data["persisted_data"] = conn; MessageBox.Show(e.ToString(), "Load " + e.Session["EnvVersion"]); }
static void project_AfterInstall(SetupEventArgs e) { //Note AfterInstall is an event based on deferred Custom Action. All properties that have //been pushed to e.Session.CustomActionData with project.DefaultDeferredProperties are //also set as environment variables just before invoking this event handler. //Similarly the all content of e.Data is also pushed to the environment variables. MessageBox.Show(e.ToString() + "\npersisted_data = " + e.Data["persisted_data"] + "\nEnvVar('INSTALLDIR') -> " + Environment.ExpandEnvironmentVariables("%INSTALLDIR%My App.exe") + "\nADDLOCAL = " + e.Session.Property("ADDLOCAL"), caption: "AfterExecute "); try { System.IO.File.WriteAllText(@"C:\Program Files (x86)\My Company\My Product\Docs\readme.txt", "test"); } catch { } }
static void project_AfterExecute(SetupEventArgs e) { //Debugger.Launch(); MessageBox.Show(e.ToString(), "AfterExecute"); }
static void project_BeforeInstall(SetupEventArgs e) { MessageBox.Show(e.ToString(), "BeforeInstall"); }
static void project_Load(SetupEventArgs e) { //Debugger.Launch(); //e.Result = ActionResult.UserExit; MessageBox.Show(e.ToString(), "Load"); }
static void project_BeforeExecute(SetupEventArgs e) { MessageBox.Show(e.ToString(), "BeforeInstall"); //e.Result = ActionResult.Failure; //e.Result = ActionResult.UserExit; //e.Result = Microsoft.Deployment.WindowsInstaller.ActionResult.UserExit; }
static void project_BeforeInstall(SetupEventArgs e) { MessageBox.Show(e.ToString(), "BeforeInstall " + AppSearch.GetProductVersionFromUpgradeCode(e.UpgradeCode)); }
static void project_AfterInstall(SetupEventArgs e) { MessageBox.Show(e.ToString(), "AfterExecute"); }
static void project_BeforeInstall(SetupEventArgs e) { MessageBox.Show(e.Session.GetMainWindow(), e.ToString(), "BeforeInstall"); }