Jump to content
Sign in to follow this  
PsychOfMSE

Convert AutoIt .exe to .msi for SCCM Distribution

Recommended Posts

PsychOfMSE

FileInstall("C:\AutoItCitrix\CitrixOnlinePluginFull.exe",@TempDir)
FileInstall("C:\AutoItCitrix\CitrixUpdate.bat",@TempDir)

If @OSArch = "X86" Then
$regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine'
$regKey = 'ClientName'
$regPath_x86 = RegRead($regAddress,$regKey)
FileChangeDir(@TempDir)
RunWait("CitrixUpdate.bat")
FileChangeDir(@TempDir)
RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"')
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x86)
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x86)

 Else
$regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine'
$regKey = 'ClientName'
$regPath_x64 = RegRead($regAddress,$regKey)
FileChangeDir(@TempDir)
RunWait("CitrixUpdate.bat")
FileChangeDir(@TempDir)
RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"')
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x64)
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Wow6432NodeCitrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x64)
EndIf

Here's my current script.  I now need to convert this to a MSI package so we can push it out through SCCM.  How do I go about passing a command line variable during install through an .msi into this script?

Is it possible?

Thanks!

Share this post


Link to post
Share on other sites
JLogan3o13

While I am all for proper application repackaging, can I ask why you need an MSI? Unless you are copying files other than your script itself, or are making a number of system/registry changes, SCCM should be able to handle just the .exe just fine.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
PsychOfMSE

The MSI wrapper is required by corporate policy.  Not sure why, but our SCCM team is extremely strict with this requirement.

I can wrap it in an .msi wrapper just fine, but my problem lies in the $CmdLine[2] pass through in:

RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"')

This is vital for passing citrix command line switches through into the executable.  If I wrap this in an .msi will the passthrough still occur?

Following scenario:

Re-Wrap to .msi and run the following command in SCCM:

CHI_LR_Citrix_Upgrade.msi /silent ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="http://xenapp" ENABLE_DYNAMIC_CLIENT_NAME="NO"

Will "/silent ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="http://xenapp" ENABLE_DYNAMIC_CLIENT_NAME="NO"" still be passed through to $CmdLine[2] ?

Edited by PsychOfMSE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×