Can SCCM 2012 launch a program during installation? (WinSQL 5.5)
I am in the process of deploying WinSQL via SCCM 2012 on Win 7 machines. I've put together a Batch file (script below) to get this all going, but have hit a bit of a wall. The program needs to launch in order it to create the folder where the serial information\file is stored. I am attempting to have the batch file install, launch, close and then write to the configuration file. The program installs, however, it does not launch afterward. Software Center shows INSTALLED, but the script never accomplishes what I need it to.
Please keep in mind, if I run it locally everything works perfectly. It's just that when it is executed via SCCM, it's not launching, closing, writing to the config file.
msiexec.exe /i "WinSQL.msi" /qn
timeout /t 15 /nobreak
start /d "%PROGRAMFILES(X86)%\synametrics technologies\winsql\" winsql.exe
timeout /t 10 /nobreak
taskkill /IM Winsql.exe
timeout /t 5 /nobreak
@echo OwnerName=ABCD >> %userprofile%\AppData\Roaming\WinSQL\WinSQL.conf
@echo CoName=ABC >> %userprofile%\AppData\Roaming\WinSQL\WinSQL.conf
@echo SerialNum=123456789 >> %userprofile%\AppData\Roaming\WinSQL\WinSQL.conf
Answer Chosen by the Author
The install will be running in the system context, and therefore won't be able to perform the other actions in the batch file that you want to run in the user context.
Assuming you have a site licence, and every user of the target machine will have access to it then there are a few ways to approach this. All of these would remove the need to launch the application first as you'd create the folder structure as part of the process.
The 'pure' MSI packaging approach would be to use an customisation file with the MSI (MST) to include the file with the package (either in the INIFILE table or as a flat file) and use ActiveSetup to populate this for all users.
Running the MSI from a batch file means that you lose some of the functionality of SCCM with regard to the handling of MSI files.
Other methods to consider are:
-Per-User SCCM package to populate the file
-Login script that uses 'if not exist' then copy to populate the file
-Script utilised by ActiveSetup to populate the file.
Hope that gives you a few pointers,
Answered 08/03/2016 by: