This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to execute application C# code during the installation of this application?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 02, 2017
12:45 AM
How to execute application C# code during the installation of this application?
Hello. First, I bag your pardon for my poor English. I create Windows installation project (ISM) of my C# WPF Prism MVVM modular application. In my C# WPF application I have Properties.Settings.Default flag called IsFirstRunAfterInstallation. The type of this flag is bool. I need that this flag must be set to true during the installation process. After completion of the installation when the application is run first time, IsFirstRunAfterInstallation flag is checked as the following:
if (My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation)
{
// do some actions here that must be done when application runs first time after its installation.
. . . . . . . . . . . . . . .
My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation = false;
My_assembly_name.Properties.Settings.Default.Save();
}
And if IsFirstRunAfterInstallation flag is true, some C# code that is needed to perform when the application runs first time will be executed (as you can see above). I need that IsFirstRunAfterInstallation flag is set to true like the folowing:
My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation = true;
My_assembly_name.Properties.Settings.Default.Save();
during each installation of my application and is checked after the installation when the application runs first time. So I have the followin question: How to execute application code during the application installation using InstallShield 2016 Premier Edition (21-days trial)?
Thanks in advance. Eugene.
if (My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation)
{
// do some actions here that must be done when application runs first time after its installation.
. . . . . . . . . . . . . . .
My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation = false;
My_assembly_name.Properties.Settings.Default.Save();
}
And if IsFirstRunAfterInstallation flag is true, some C# code that is needed to perform when the application runs first time will be executed (as you can see above). I need that IsFirstRunAfterInstallation flag is set to true like the folowing:
My_assembly_name.Properties.Settings.Default.IsFirstRunAfterInstallation = true;
My_assembly_name.Properties.Settings.Default.Save();
during each installation of my application and is checked after the installation when the application runs first time. So I have the followin question: How to execute application code during the application installation using InstallShield 2016 Premier Edition (21-days trial)?
Thanks in advance. Eugene.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 02, 2017
11:13 AM
C# code is run thru what is called a Custom Action in installers. Are your settings being saved to a file in this case?
I use this technology to run all of my C# code through the MSI file these days. By authoring it using these tools it appears to MSIEXEC.EXE as a standard Win32 DLL, but the compiler takes care of the extra work in this case. So, I code in C# and using the DTF tools from WiX it spits out the Win32 compatible file.
http://blog.iswix.com/2008/05/deployment-tools-foundation-dtf-managed.html
It's one way to accomplish it.
Chad
I use this technology to run all of my C# code through the MSI file these days. By authoring it using these tools it appears to MSIEXEC.EXE as a standard Win32 DLL, but the compiler takes care of the extra work in this case. So, I code in C# and using the DTF tools from WiX it spits out the Win32 compatible file.
http://blog.iswix.com/2008/05/deployment-tools-foundation-dtf-managed.html
It's one way to accomplish it.
Chad