Windows Installer
-
Hi, I am creating a Windows Installer wherein I have added a "RegisterUser" dialog to the installer interface. However, I would like this "RegisterUser" dialog only when it is being freshly installed on a machine. For eg. If I am installing the software on machine A for the first time, then RegisterUser dialog will be displayed on the screen. After that if i uninstall the software from that machine and again re-install the same , then the "RegisterUser" dialog should not be displayed again, since the software was already previously installed on that machine(A) Please Help!!!.
Thanking you in Advance Kind Regards Pratik Shah
-
Hi, I am creating a Windows Installer wherein I have added a "RegisterUser" dialog to the installer interface. However, I would like this "RegisterUser" dialog only when it is being freshly installed on a machine. For eg. If I am installing the software on machine A for the first time, then RegisterUser dialog will be displayed on the screen. After that if i uninstall the software from that machine and again re-install the same , then the "RegisterUser" dialog should not be displayed again, since the software was already previously installed on that machine(A) Please Help!!!.
Thanking you in Advance Kind Regards Pratik Shah
I would recommend creating your own custom action. Create a new assembly containing your own user registration form and a class derived from System.Configuration.Install.Installer. Handle the AfterInstall event and display your own form: // MyInstaller is derived from the class 'Installer'. MyInstaller() : base() { AfterInstall += new InstallEventHandler(AfterInstallEventHandler); } private void AfterInstallEventHandler(object sender, InstallEventArgs e) { // Show the user registration form. if (NewUser()) new MyUserRegistrationForm().Show(); } private bool NewUser() { // Determine whether this is a clean install. }