Beispiel #1
0
 static void Msi_Load(SetupEventArgs e)
 {
     if (e.IsInstalling)
     {
         MessageBox.Show(e.ToString(), "Load");
     }
 }
Beispiel #2
0
 static void Msi_Load(SetupEventArgs e)
 {
     if (!e.IsUISupressed && !e.IsUninstalling)
     {
         MessageBox.Show(e.ToString(), "Load");
     }
 }
Beispiel #3
0
 static void Msi_AfterInstall(SetupEventArgs e)
 {
     if (!e.IsUISupressed && !e.IsUninstalling)
     {
         MessageBox.Show(e.ToString(), "AfterExecute");
     }
 }
Beispiel #4
0
 static void Msi_BeforeInstall(SetupEventArgs e)
 {
     if (e.IsInstalling)
     {
         MessageBox.Show(e.ToString(), "BeforeInstall");
     }
 }
Beispiel #5
0
 static void Msi_BeforeInstall(SetupEventArgs e)
 {
     if (!e.IsUISupressed && !e.IsUninstalling)
     {
         MessageBox.Show(e.ToString(), "BeforeInstall");
     }
 }
Beispiel #6
0
    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"]);
    }
Beispiel #7
0
    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"]);
    }
Beispiel #8
0
 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 { }
 }
Beispiel #9
0
    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"]);
    }
Beispiel #10
0
 static void project_AfterExecute(SetupEventArgs e)
 {
     //Debugger.Launch();
     MessageBox.Show(e.ToString(), "AfterExecute");
 }
Beispiel #11
0
 static void project_BeforeInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.ToString(), "BeforeInstall");
 }
Beispiel #12
0
 static void project_Load(SetupEventArgs e)
 {
     //Debugger.Launch();
     //e.Result = ActionResult.UserExit;
     MessageBox.Show(e.ToString(), "Load");
 }
Beispiel #13
0
 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;
 }
Beispiel #14
0
 static void project_BeforeInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.ToString(), "BeforeInstall " + AppSearch.GetProductVersionFromUpgradeCode(e.UpgradeCode));
 }
Beispiel #15
0
 static void project_AfterInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.ToString(), "AfterExecute");
 }
Beispiel #16
0
 static void project_AfterInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.ToString(), "AfterExecute");
 }
Beispiel #17
0
 static void project_BeforeInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.ToString(), "BeforeInstall");
 }
Beispiel #18
0
 static void project_BeforeInstall(SetupEventArgs e)
 {
     MessageBox.Show(e.Session.GetMainWindow(), e.ToString(), "BeforeInstall");
 }