
MichaelSO
Members-
Posts
4 -
Joined
-
Last visited
Everything posted by MichaelSO
-
Installing Microsoft .NET Framework 4 script issue
MichaelSO replied to MichaelSO's topic in AutoIt General Help and Support
I did as you say and ran the script from SciTe and I do in fact receive the read out: However, when I Compile the script and run the .exe from the command prompt, the program runs but again, I am not getting the messages, ".NET Framework 4.0 Extended already installed, terminating operation" Maybe I am missing something when compiling? While having SciTE-Lite open and the script dotNetFx4.au3 open, and the required file present dotNetFx40_Full_x86_x64.exe, I then click Tools >> Compile which then creates the dotNetFx4.exe file. I then run same file at the command prompt and again, I receive no output messages as in the ConsoleWrite messages... I did edit the original script to include only the .NET 4 portion. This is what I am using: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\..\Images\CSO.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Simon McBryde Script Function: Install .NET Framework 4.0 #ce ---------------------------------------------------------------------------- #include <array.au3> ; Check to see if .NET Framework 4.0 is already installed and quit if it is If _CheckDotNet4() = 1 Then ConsoleWrite('.NET Framework 4.0 Extended already installed, terminating operation' & @CRLF) Exit 0 EndIf ; Install .NET Framework 4.0 FileInstall('dotNetFx40_Full_x86_x64.exe', @ScriptDir & '\') _CommandExecute('"' & @ScriptDir & '\dotNetFx40_Full_x86_x64.exe" /q /norestart') ; Check to see if .NET Framework 4.0 installation was successful If _CheckDotNet4() = 1 Then ConsoleWrite('.NET Framework 4.0 Extended installed successfully' & @CRLF) Else ConsoleWrite('.NET Framework 4.0 Extended not present after attempted installation' & @CRLF) Exit 1 EndIf Exit 0 Func _CommandExecute($Command) Local $Pid = Run(@ComSpec & ' /c ' & $Command, '', @SW_HIDE) ProcessWaitClose($Pid) EndFunc ;==>_CommandExecute Func _CheckDotNet4() Local $NETInstalled RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', '') If @error > 0 Then $NETInstalled = 0 Else $NETInstalled = 1 EndIf Return $NETInstalled EndFunc ;==>_CheckDotNet4 Any additional thoughts on what I might be doing wrong? Thank you in advance, MichaelSO -
Installing Microsoft .NET Framework 4 script issue
MichaelSO replied to MichaelSO's topic in AutoIt General Help and Support
I have run the script and it is indeed working. However, the original .exe file, that I got from the author's website, actually shows text messages correlating to the code: ConsoleWrite('.NET Framework 4.0 Extended already installed, terminating operation' & @CRLF) Yet, when I run the script, these console writes are not occurring... So, the script executes and basically completes without having the 'waiting' that the original .exe has in it... along with the ConsoleWrite messages appearing... Maybe the author added some additional coding and forgot to include that in the .au3 script? Any idea or advice on how to get the ConsoleWrite to actually work? Thanks in advance, Michael -
Installing Microsoft .NET Framework 4 script issue
MichaelSO replied to MichaelSO's topic in AutoIt General Help and Support
Thank you so much for your reply! I have gleaned some good information from your post. So, let me start with your first question as to why I am not simply running this from the command line. If one were to simply need to install and not worry about whether or not .NET 4 was already installed, then this would work wonderfully, However, if .NET 4 is already installed, by executing this again, .NET 4 will actually reinstall. This requires additional time which is not necessary. Originally, I set out to find a VBscript to handle the task of checking to see if .NET 4 was installed and if not install it. That was fairly easy to accomplish. Yet, the VBscript didn't work out exactly the way I wanted it to... Just so you are aware, I am pretty new to scripting in general so I am sure that the script I used could have been modified to work as I wanted it to but in the end, I just didn't have the patience to try and figure it out. So, I kept searching... and then I stumbled on this wonderful script that actually has a WAITING method implemented... so the script does not complete until either .NET is installed or there is some kind of error or it finds that it is already installed. The fact that you can turn a AutoIT script into a .exe is wonderful! I honestly am greatly motivated to learn AutoIT just because of this reason alone. Anyways, based on your response, I will attempt to execute the script from the command prompt and see if I can get any additional information from that. Thank you for the tip on how to properly put CODE inside these posts. When I had posted the code I did not like how it looked as it made it much harder to read. So, when I post code, I will follow your advice on how to properly post the code to make it more legible. Because I am so new to scripting... the only scripting I have ever done was creating .bat files... VBscripting, PowerShell scripting, and now this AutoIT scripting is all new to me but I am convinced that I need to become more proficient with all three. I can't become proficient until I actually LEARN them. AutoIT being free and seeing how awesome it is... it just seems like a obvious win win to me to learn. I will post back once I have dug deeper into this. And oh yeah, when I compiled I did it with the dotNetFx40_Full_x86_x64.exe included in the directory. I figured that out simply because at first when I ran the compile, I received and error message telling me that the file was missing... along with the other files too... If your response is an indicator of the community support behind using AutoIT, that is awesome!! -
I learned about AutoIT from this guys post http://www.scriptingsimon.com/2010/10/installing-microsoft-net-framework-4/ I wanted to change his code so that only .NET 4 was being installed. However, when I compile the script and then run the newly created .exe, I do not get the same result as his created .exe which is located at the link above. When I run my newly created .exe, it appears as if nothing happens. I checked event viewer and did not find anything there letting me know that the installation had begun. Because I am a complete and total noob to scripting using AutoIT, I was hoping that a more seasoned individual might be able to assist me in the compiling part of this script. Here is the script with the author's name included in the script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=....ImagesCSO.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Simon McBryde Script Function: Install .NET Framework 4.0 #ce ---------------------------------------------------------------------------- #include <array.au3> ; Check to see if .NET Framework 4.0 is already installed and quit if it is If _CheckDotNet4() = 1 Then ConsoleWrite('.NET Framework 4.0 Extended already installed, terminating operation' & @CRLF) Exit 0 EndIf ; Check to see if Windows Imaging Component is installed and install if not If FileExists(@SystemDir & 'Windowscodecs.dll') Then ConsoleWrite('Windows Imaging Component present, continuing operation' & @CRLF) Else ConsoleWrite('Windows Imaging Component NOT present, attempting installation' & @CRLF) If @OSArch = 'x86' Then ConsoleWrite('32-Bit architecture detected. Installing wic_x86_enu.exe' & @CRLF) FileInstall('wic_x86_enu.exe', @ScriptDir & '') _CommandExecute('"' & @ScriptDir & 'wic_x86_enu.exe" /q /norestart') EndIf If @OSArch = 'x64' Then ConsoleWrite('64-Bit architecture detected. Installing wic_x64_enu.exe' & @CRLF) FileInstall('wic_x64_enu.exe', @ScriptDir & '') _CommandExecute('"' & @ScriptDir & 'wic_x64_enu.exe" /q /norestart') EndIf ; Verifty installation of Windows Imaging Component and quit if not successful If FileExists(@SystemDir & 'Windowscodecs.dll') Then ConsoleWrite('Installation of Windows Imaging Component successful, continuing operation' & @CRLF) Else ConsoleWrite('Installation of Windows Imaging Component NOT successful, terminating operation' & @CRLF) Exit 1 EndIf EndIf ; Install .NET Framework 4.0 FileInstall('dotNetFx40_Full_x86_x64.exe', @ScriptDir & '') _CommandExecute('"' & @ScriptDir & 'dotNetFx40_Full_x86_x64.exe" /q /norestart') ; Check to see if .NET Framework 4.0 installation was successful If _CheckDotNet4() = 1 Then ConsoleWrite('.NET Framework 4.0 Extended installed successfully' & @CRLF) Else ConsoleWrite('.NET Framework 4.0 Extended not present after attempted installation' & @CRLF) Exit 1 EndIf Exit 0 Func _CommandExecute($Command) Local $Pid = Run(@ComSpec & ' /c ' & $Command, '', @SW_HIDE) ProcessWaitClose($Pid) EndFunc ;==>_CommandExecute Func _CheckDotNet4() Local $NETInstalled RegRead('HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full', '') If @error > 0 Then $NETInstalled = 0 Else $NETInstalled = 1 EndIf Return $NETInstalled EndFunc ;==>_CheckDotNet4 I even tried just running this script as a stand alone script using AutoIT installed, the latest version. It too produces nothing... no errors... nothing happens. So perhaps there is something wrong with the version I have installed and the version that this was originally written for? I have no idea. I simply want to cut out this section: ; Check to see if Windows Imaging Component is installed and install if not If FileExists(@SystemDir & 'Windowscodecs.dll') Then ConsoleWrite('Windows Imaging Component present, continuing operation' & @CRLF) Else ConsoleWrite('Windows Imaging Component NOT present, attempting installation' & @CRLF) If @OSArch = 'x86' Then ConsoleWrite('32-Bit architecture detected. Installing wic_x86_enu.exe' & @CRLF) FileInstall('wic_x86_enu.exe', @ScriptDir & '') _CommandExecute('"' & @ScriptDir & 'wic_x86_enu.exe" /q /norestart') EndIf If @OSArch = 'x64' Then ConsoleWrite('64-Bit architecture detected. Installing wic_x64_enu.exe' & @CRLF) FileInstall('wic_x64_enu.exe', @ScriptDir & '') _CommandExecute('"' & @ScriptDir & 'wic_x64_enu.exe" /q /norestart') EndIf ; Verifty installation of Windows Imaging Component and quit if not successful If FileExists(@SystemDir & 'Windowscodecs.dll') Then ConsoleWrite('Installation of Windows Imaging Component successful, continuing operation' & @CRLF) Else ConsoleWrite('Installation of Windows Imaging Component NOT successful, terminating operation' & @CRLF) Exit 1 EndIf EndIf If anyone could point me in the right direction or perhaps tell me what I need to change, I would great appreciate it! I absolutely LOVE how a script, created in AutoLT, can be turned into an .exe with the necessary files included. That is brilliant!!