We help IT Professionals succeed at work.

Create nullsoft script to run exe from CD after runtime installation

medxmedia
medxmedia asked
on
Hi,

I am trying to distribute an Adobe Air application on CD.  My client has a license for distributing the air runtime.  He wants me to check for air installation once the CD is installed.  If it's not installed he wants me to run the air installer and then (upon completion of the air installation) launch the air application from CD.  If it is installed, he wants me to run the air application from CD.

I've been playing with nullSoft but can't get thsi to work.  Your expert advice would be appreciated.

Best regards,


Chris
Comment
Watch Question

Ove

Commented:
for problems like this we're using "Silent2MSI". Unfortuanately the homepage is only available in german language - but the toll will of course also work inside non-german-language environments.

http://www.realschule-ehingen.de/index.php?menuid=77&reporeid=88

In short:
Silent2MSI creates an MSI-Package from a script. Inside this script (s2m.ini) you may do your chacks and several installations.

Have a look inside the [install] area in the attached file. The i do uninstall older versions from FoxIt-Reader, install the new one, copy some files and change ntfs-security-settings....

Ove

s2m.ini

Author

Commented:
Hi Ove,

Thanks so much for your reply.  I'll see if I can get this to work.  

I had also posted on the winamp forum and received a suggestion that also solved my problem.  What I clarified in that post was that the air installation which was launched using ExecWait wasn't completed before the executable was launched thus prompting the message, " this file requires Adobe Air . . ."

Is the solution you have suggested still applicable in that case?
Ove

Commented:
i didn't exactly get what you mean - but if things are scriptable you may get it up and running that way.
Due to the fact that these msi-packages are also used for unattended installations you do have to check if it works.

Ove
You can use something like AutoIT which is just standard scripting rather than a full packager.  Basically you want to check that Adobe Air is installed first and if not found install Adobe Air and the Run the App so in AutoIT it would be something like: Note haven't tested this but should work after you've modified the names and paths in the code.

Cheers

#NoTrayIcon
#Region
#AutoIt3Wrapper_icon=CustomIcon.ico
#AutoIt3Wrapper_UseUpx=n
#EndRegion

;~ Check for Adobe Air and Install if not found in registry
If RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\<Insert Adobe Air Guid Here>', 'DisplayName') = 0 Then
  RunWait(@ScriptDir & '\AdobeAir Folder\Setup.exe /switches')
EndIf

;~ Wait until Adobe Air Executable is available
While 1
  If FileExists(@ProgramFilesDir & '\Adobe\Adobe Air\AdobeAir.exe') Then Exitloop
  Sleep(500)
Wend

;~ Installation has finished or was already installed, now run your application .
Run(@ProgramFilesDir & '\Adobe\Adobe Air\AdobeAir.exe "' & @ScriptDir & '\Name of the Application'"')

Open in new window

Author

Commented:
Hi matrixnz,

Thanks for your comment.  I tried to ammend you script (once I figured out AutoIT was not a NullSoft thing).  I assume that the "If RegRead" portion is meant to check whether the "Display Name" entry exists for the Adobe Air uninstall GUID and only install Air if in cases where 0 is returned meaning it doesn't exist.  But it appears to try to install Air either way.  Do you see anything I'm doing that would explain this?

Otherwise it it executing faster than the NullSoft script--- but I'm new to both.

Again, thanks for your help


#NoTrayIcon
#Region
#AutoIt3Wrapper_icon=CustomIcon.ico
#AutoIt3Wrapper_UseUpx=n
#EndRegion

;~ Check for Adobe Air and Install if not found in registry
If RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{FE23D063-934D-4829-A0D8-00634CE79B4A}', 'DisplayName') = 0 Then
  RunWait(@ScriptDir & '\AdobeAIRInstaller.exe')
EndIf

;~ Wait until Adobe Air Executable is available
While 1
  If FileExists(@ProgramFilesDir & '\Common Files\Adobe AIR\Versions\1.0\Adobe AIR.dll') Then Exitloop
  Sleep(500)
Wend

;~ Installation has finished or was already installed, now run your application .
Run(@ScriptDir & '\content\passAssured.exe')

Open in new window

Hi medxmedia, sorry I actually put you wrong, not enough sleep, rather than 0 it should of just been just ""

Sorry about that.

Cheers

RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{FE23D063-934D-4829-A0D8-00634CE79B4A}', 'DisplayName') = ""

Open in new window

Author

Commented:
The solution offered by matrixnz worked beautifully.  As I am new to both the nullSoft and AutoIT platforms I will continue to explore their capabilities.  I believe Ove's suggestion may also be workable and will try it when I have more time to experiment.

Thank you