vnavna Posted February 22, 2011 Share Posted February 22, 2011 (edited) I am trying to deploy a new Adobe Reader 10 to clients but now clients are running x86 XP and Windows 7 64bit. I need to make this so the code will detect the OS architecture then run the appropriate segments of the code. I am trying to run a script to skip lines if the OS architecture is x86 or x64. How would I go about doing this? I am unsure of where to put the select command to go to the appropriate line in the code. expandcollapse popupIf @OSArch = "X86" If @OSArch = "X64" If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A80000000002}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A80000000002} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81100000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A90000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A90000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A94000000001") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A94000000001 /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A80000000002}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A80000000002} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81100000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A90000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A90000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A94000000001") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A94000000001 /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf Edited February 22, 2011 by vnavna Link to comment Share on other sites More sharing options...
UEZ Posted February 22, 2011 Share Posted February 22, 2011 Try this: If @OSArch = "X86" Then ;x86 installation Else ;else x64 installation EndFunc Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 Is this what you mean? I put in the code that you requested but I want to make sure that I put them in the correct locations. expandcollapse popupIf @OSArch = "X86" Then If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A80000000002}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A80000000002} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81100000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A90000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A90000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A92000000001}") Then Exit Else If FileExists ("C:\Program Files\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A94000000001") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A94000000001 /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf Else If @OSArch = "X64" Then If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A80000000002}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A80000000002} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81100000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A90000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A90000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000001} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A91000000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A91000000003} /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A92000000001}") Then Exit Else If FileExists ("C:\Program Files (x86)\Adobe\Reader 9.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A94000000001") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A94000000001 /qn","",@SW_HIDE) EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf EndFunc Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 Try this: If @OSArch = "X86" Then ;x86 installation Else ;else x64 installation EndFunc Br, UEZ I am having trouble of finding out where to put this code along with the other If statements. It doesn't seem to work. Link to comment Share on other sites More sharing options...
trancexx Posted February 22, 2011 Share Posted February 22, 2011 (edited) Then maybe you should focus on crochet. Edited February 22, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 22, 2011 Share Posted February 22, 2011 Why does it matter which architecture you have when you're running the same code anyway? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 The main line of the code that fails would be the following. In an x86 Architecture the Program files (x86) doesn't exist so the code would run every time and in an x64 system the Program Files without the (x86) would not exist either so that would run again and again instead of exiting. If FileExists ("C:\Program Files\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf If FileExists ("C:\Program Files (x86)\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 trancexx Thanks for your help. Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 I could use just the two IF commands to do this. The reason all of the other lines are in there is because Adobe and their customization wizard for Adobe Reader always failed on uninstalling the previous versions of Reader but since version 9.1 I believe that they have finally fixed it and made it work. Still the paths are different on different OS architectures and I would like to make it so If @OSArch = "X86" it would run the appropriate x86 command and the same goes for IF @OSArch = "X64". Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 22, 2011 Share Posted February 22, 2011 Use @ProgramFilesDir .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
kylomas Posted February 22, 2011 Share Posted February 22, 2011 (edited) vnavna, You are running the same install files regardless of architecture (as AdmiralAlex pointed out). UEZ gave you what you need, This is the structure: ; ; ; _Main() func _Main() If @OSArch = "X86" Then ;insert X86 files after this Else ;insert x64 files after this endif EndFunc If this is for professional use I would advise you to run this past someone experienced in your environment. Good Luck, kylomas Edit: Shit, typing too slow, you guys got in under me!! Edited February 22, 2011 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 I tried that earlier but it didn't work because Windows 7 x64 has 2 different Program Files paths. The normal C:\Program Files and C:\Program Files (x86). So I think by default that it goes to the x64 path of C:\Program Files. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 22, 2011 Share Posted February 22, 2011 (edited) I tried that earlier but it didn't work because Windows 7 x64 has 2 different Program Files paths. The normal C:\Program Files and C:\Program Files (x86). So I think by default that it goes to the x64 path of C:\Program Files.Then you are running x64 AutoIt. Use#AutoIt3Wrapper_UseX64=nto run x86.Edit: Or just use the If if that's what you want, you know how to use it (If FileExists ("C:\Program Files\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81000000003}") Then), no one is stopping you! Edited February 22, 2011 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 vnavna, You are running the same install files regardless of architecture (as AdmiralAlex pointed out). UEZ gave you what you need, This is the structure: ; ; ; _Main() func _Main() If @OSArch = "X86" Then ;insert X86 files after this Else ;insert x64 files after this endif EndFunc If this is for professional use I would advise you to run this past someone experienced in your environment. Good Luck, kylomas Edit: Shit, typing too slow, you guys got in under me!! How would you put in the second If FileExists statement without getting a Syntax error? I am not used to using functions. Example If @OSArch = "X86" Then If FileExists ("C:\Program Files\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then Exit Else Run("\\Server\Adobe Reader 10\Setup.exe") EndIf If @OSArch = "X64" Then Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 22, 2011 Share Posted February 22, 2011 (edited) You are missing a EndIf Edit: Would make more sense with a ElseIf though Edited February 22, 2011 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 I am really missing the GOTO command. lol Link to comment Share on other sites More sharing options...
vnavna Posted February 22, 2011 Author Share Posted February 22, 2011 The issue that I am running into is that the next line is another IF fileExists statement which does not get skipped over and go to the If @OSArch = "X64" line. What am I missing? Link to comment Share on other sites More sharing options...
Legacy99 Posted February 23, 2011 Share Posted February 23, 2011 (edited) What you need to do is: when the If condition for the 32bit and if it's false, the Else part will be the default (for 64bit in your case) Think of an "IF/Else" like this: "IF" this part is true then end, ELSE this part is true because the "IF" part was false. IF x86 Then Do the check and uninstall of the versions for 32 bit OS Else ; this part will be the default because x86 part is false Do the check and uninstall of the 64 bit OS Endif For example If @CPUArch = "X86" Then If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 32 bit Adobe 10 here Else ;x64 part starts now since X86 was false otherwise it is skipped since the first section ran (it was a 32bit OS). If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 64 bit Adobe 10 here EndIf ;Put an installer that is OS independant here and remove the ones that are in the IF statment.. Oh, and use @ProgramFilesDir, that way it's more like a wildcard and you don't have to worry about the exact path, the Macro will take care of it. Edited February 23, 2011 by Legacy99 Link to comment Share on other sites More sharing options...
vnavna Posted February 23, 2011 Author Share Posted February 23, 2011 (edited) What you need to do is: when the If condition for the 32bit and if it's false, the Else part will be the default (for 64bit in your case) Think of an "IF/Else" like this: "IF" this part is true then end, ELSE this part is true because the "IF" part was false. IF x86 Then Do the check and uninstall of the versions for 32 bit OS Else ; this part will be the default because x86 part is false Do the check and uninstall of the 64 bit OS Endif For example If @CPUArch = "X86" Then If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 32 bit Adobe 10 here Else ;x64 part starts now since X86 was false otherwise it is skipped since the first section ran (it was a 32bit OS). If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 64 bit Adobe 10 here EndIf ;Put an installer that is OS independant here and remove the ones that are in the IF statment.. Oh, and use @ProgramFilesDir, that way it's more like a wildcard and you don't have to worry about the exact path, the Macro will take care of it. I tried that before and it says that I am missing an EndIf with the "If @CPUArch = "X86" Then" along with If FileExists(@ProgramFilesDir &"\path") doesn't work with the "C:\Program Files (x86)" path. Edited February 23, 2011 by vnavna Link to comment Share on other sites More sharing options...
vnavna Posted February 23, 2011 Author Share Posted February 23, 2011 Here is a test code that I tried. The top one is the only one that will run because of running on a x64 bit PC. @ProgramFilesDir only works with the default x64 bit path of the files. If FileExists(@ProgramFilesDir & "\activePDF\PrimoPDF") Then ; actual path "C:\Program Files\activePDF\PrimoPDF" Run("notepad") Sleep(1500) Send("PDF") EndIf If FileExists(@ProgramFilesDir & "\Alcohol Soft\Alcohol 120") Then ;Actual path "C:\Program Files (x86)\Alcohol Soft\Alcohol 120" Run("notepad") Sleep(1500) Send("Alcohol") EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now