0

I'm struggling to get my installer to launch a freshly installed executable (written in C#). It logs a 1721 error no matter what I try to do. What works is: 1. I run the installer 2. Wait for it to fail 3. Launch the exe from the location it installed to with the command line args that are logged in the log file generated with /l*v

So, the file appears to be installed to the right location with all the valid data and file permissions. It just isn't running under the right user account (maybe)?

Any ideas?

Kevin
  • 83
  • 8
  • If you share the CustomAction where you invoke the executable, the Sequence when you invoke it and maybe also an excerpt from the logfile the chances are bigger that someone is able to analyze your problem. – taffit Jul 29 '15 at 15:30
  • Hopefully this will help: – Kevin Jul 30 '15 at 02:45
  • ... UPGRADINGPRODUCTCODE OR (NOT REMOVE = "ALL") ... – Kevin Jul 30 '15 at 02:46
  • Also, the error that I get during installation is "There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor." – Kevin Jul 30 '15 at 04:25
  • Where is the type 51 custom action named QtExecDeferredExampleWithProperty scheduled? Also i observe that QtExecDeferredExampleWithProperty is a private property. Remember, the values of private properties are not passed from the UI sequence to the execute sequence. When execution switches from the UI phase to the Execute phase, the values of private properties are reset to default values. So, in this particular case, you will have to ensure that both of your custom actions are scheduled in the Execute phase. The other option is to make QtExecDeferredExampleWithProperty a public property – Kiran Hegde Jul 30 '15 at 11:42
  • i.e All Caps. You can also verify if your executable is run during the installation and the actual command line parameters being passed by making use of an utility called "Process Monitor". Set filters on Process Monitor for your exectuable and observe the parameters being passed. Hope this helps. – Kiran Hegde Jul 30 '15 at 11:43
  • Thanks Kiran for the help. I changed the property to uppercase (DBINSTALLERPATH) to address the private property issue. In the log file I see that it is set soon after InstallFiles executes (it logs Action ended InstallFiles return value 1 about 15 lines before logging SetDBINSTALLERPATH). InstallFinalize executes and at the end of this it runs QtExecExample. The logging shows the correct path for DBInstaller.exe after "3:" in the "note: 1: 1721 ..." log message with all the correct args after "4:". It logs the same details with ActionType 3122 above that. – Kevin Jul 30 '15 at 13:20
  • Have you made sure using Process Monitor that the correct command has been launched? If yes, then there is no problem with the msi custom action and the executable is being launched as expected. Then,it has something to do with your DB installer executable. Try executing your entire command on the command prompt and see if there is an error. Its possible that your DB installer executable is erroring out , returning a non zero error code to the msi engine. One other thing, can you **secure** your public properties i.e add your public properties to the "SecureCustomProperties"? – Kiran Hegde Jul 30 '15 at 15:28
  • Kiran, I finally got a chance to try Process Monitor. If I'm using it correctly (I set a path filter to contain DBInstaller.exe) it just shows a bunch of file creation etc. but I don't see an entry that shows execution... What now? – Kevin Aug 15 '15 at 13:28

1 Answers1

0

At first I solved the problem by doing this:

<CustomAction Id="DbInstallerExec"
              Directory="SETUPFOLDER"
              Impersonate="yes"
              Execute="deferred"
              ExeCommand='"[SETUPFOLDER]DBInstaller.exe"
                          [DB_SERVER] [DB_DATABASE]
                          [PPME_BASE_DATA_FOLDER] [%TEMP]
                          [SETUPFOLDER] ImportData SqlScripts'
              Return="check" />

Having the Directory attribute appeared to at least getting the executable to launch, it then failed to perform certain actions and still returned an error code. To resolve that issue I changed Impersonate to "yes".

My second improved attempt was the following:

(this allows the console app to launch hidden from view which seems a bit more professional)

For some reason WixQuietExec (with SetProperty) wouldn't work for me but CAQuietExec did work:

<CustomAction Id="DbInstallerExec_Cmd"
              Property="DbInstallerExec"
              Value='"[SETUPFOLDER]DBInstaller.exe"
              [DB_SERVER] [DB_DATABASE] [PPME_BASE_DATA_FOLDER]
              [%TEMP] [SETUPFOLDER] ImportData SqlScripts' />
<CustomAction Id="DbInstallerExec"
              BinaryKey="WixCA"
              DllEntry="CAQuietExec"
              Execute="deferred"
              Impersonate="yes"
              Return="check" />
<InstallExecuteSequence> ...
  <Custom Action="DbInstallerExec_Cmd" Before="DbInstallerExec">
    UPGRADINGPRODUCTCODE OR (NOT REMOVE = "ALL")
  </Custom>
  <Custom Action="DbInstallerExec" Before="InstallFinalize">
    UPGRADINGPRODUCTCODE OR (NOT REMOVE = "ALL")
  </Custom>
</InstallExecuteSequence> ...
Kevin
  • 83
  • 8