I'm currently trying to build an Advanced Installer for my software. My software should later be able to run on Windows Server 2008 R2 (and possibly Windows Server 2012). Unfortunately, it needs the "Desktop-Experience" Feature - so I would love to check this as a Pre-Requisite in Advanced Installer. Unfortunately (again), there is no pre-defined method of checking this, so I tried a couple of approaches:
- Scanned the registry before and after installing Desktop-Experience (in a VM) - there are lots of changes in the registry, but none of them struck me as being a good way to check the installation status of Desktop-Experience
- Custom Action. Running the batch-file from a custom action seems not to be possible during the initialization of the Installer, because the batch file has not yet been deployed to the target machine. Therefore, I cannot run the batch file with a "DoAction" on the PrepareDlg (which would be the latest Dialog where it would make sense IMO)
- Custom Pre-Requisite. This has the advantage doing the check only on Windows Server machines. Unfortunately, the Check would always have to be done, but I could live with that. I wrote a batch script and called that batch script from the Pre-Requisite ("Main Setup File"). I know batch files aren't really officially supported but it works.
Next I told the batch script to "cd" to %WINDIR%\System32 and issued a "dir" command - surprise: ServerManagerCmd.exe is not there, however a bunch of other files and the Free-Space seemed to be correct. Other files are missing there as well, it reported only about a fifth of the actual available files. Then I renamed one of the actual files in C:\Windows\System32 (in the VM), re-ran the Installer - even bigger surprise: the "dir" command still listed the original (not-renamed) file.
So my questions would be:
1. HUH? How in the world does the Batch-Script see content in %WINDIR%\System32 that is no longer on the machine where the installer runs (because I renamed that file) ?
2. HUH? How in the world does the Batch-Script NOT see content in %WINDIR%\System32 that is actually on the machine where the installer runs (i.e. ServerManagerCmd.exe) ?
3. Actually the most important question: Does anybody have a good idea, how to check for Desktop-Experience Feature and install it if not yet availble? Preferably as a custom Pre-Requisite? Or (if checking is not possible) how to always issue an "Install Desktop-Experience" command and check the return values (e.g. from ServerManagerCmd.exe) ?
AdvancedInstaller 9.6, developing on Win7, trying to run on Windows Server 2008 R2 (in a VMware Virtual Machine)
Best regards
Martin
FOLLOW US
Get the latest news in Application Packaging