0
votes

Well I am working with WIX to fix some issues in the installer and I have a issue where my installer does not runs good in Windows Server 2008 x64 and x86 but runs very good in the other versions as Windows 7,Vista,Server 2012...So I find that the installer cannot write some files that service needs to run in C:\Users[some user]\AppData\Local and reviewing the issue I found that in Windows Server 2008 the files are writing after service is started and the software crashes so I did some changes in the my InstallExecuteSequence as image shows Orca Sequence

As you can see my custom action called ValidateLocalInstallation has 1501 in the sequence table and the StartServices has 5900 but when I run the installer the ValidateLocalInstallation custom actions is executed after StartServices and the issue persist and the services runs with errors.

this is my configuration for this CA CustomActions configuration

1.- I cannot change the path of this files because it works fine in others O.S 2.- My changes in the second images does not work..... the files are writed after StartServices CA is executed.

Anybody has any idea....

1
You can place your service start CA at last of installation.vinay

1 Answers

0
votes

There's not enough detail to analyze the likely issue, but I can point out what won't work in your situation:

Your ValidateLocalInstallation custom action is immediate, which means it runs before the system is even changed at all by anything in the MSI file. No files have been written and no services have been installed or started. So the issue is not, as you state, anything to do with running after StartServices. Installations are two phase - immediate means write the execution/rollback script, call immediate custom actions, don't do anything to the system. Deferred is when the install actually does something - it calls deferred custom actions and does the work. Yes, if you look in a verbose log you might see things in a confusing order, but that's because there are two StartServices entries, one immediate (just a script/rollback entry) and one that really starts installed services, so my guess is that you are misinterpreting the log.

It's marked as impersonate=no, and that's not going to help. Immediate custom actions run with the installing user's credentials so impersonate=no is irrelevant. You're running with the installing user's credentials.

Immediate custom actions that run with the installing user's credentials are not elevated (unless you launched the entire MSI setup from an elevated context) so it's possible that failures in your code may be security related, depending on what your code does.

There's no way to tell if your custom action is actually working. It might do all kinds of things, catch errors, and then return a success result so that the installation continues anyway. Without seeing your code there's no way to tell if it's working, but if you're using return=check you need to be sure to return an error result if anything goes wrong so that the install will fail and roll back, that is the point of return=check. Clearly, it seems to me that if the files don't get created then you should fail the install.

It's not clear to me why you can't install the files to that folder - the LocalAppDataFolder property is probably the one you'd need. I suspect that you need to be installing those files and then adding content with a deferred custom action before StartServices. I'd also pass the LocalAppDataFolder property value to your custom action to be sure you know the corrrect location because if you find out that you need deferred and impersonate=no, then your CA will run with the local system account, and attempts to get the "curent user's" local app data folder will be the system account's, not the installing user's.