SirHaschke Posted January 31, 2012 Share Posted January 31, 2012 Hello, on my german XP Station i create this script: Run("7z920.exe") WinWaitActive("7-Zip 9.20 Setup") Send("{ENTER}") WinWaitActive("7-Zip 9.20 Setup","&Finish") Send("{ENTER}") Run("C:\Programme\7-Zip\7zFM.exe") WinWaitActive("7-Zip Dateimanager") Send("{ALTDOWN}") Send("!e") Send("!o") Send("{ALTUP}") WinWaitActive("Optionen") Send("!m") Send("{TAB}") Send("{TAB}") Send("{ENTER}") WinWaitActive("7-Zip Dateimanager") Send("{ALTDOWN}") Send("!d") Send("!e") Send("{ALTUP}") On my netherland test system i try this. The installations starts and the script stops here: Run("C:\Programme\7-Zip\7zFM.exe") I change the line to Run("C:\Program Files\7-Zip\7zFM.exe") but this doesn't solve my problem. Any idea why my script stops at this point? Thanks Dennis Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 31, 2012 Moderators Share Posted January 31, 2012 Hi, SirHaschke. What is the error (console output) when you get to this point in your script? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
SirHaschke Posted February 2, 2012 Author Share Posted February 2, 2012 Hello, how can i see the console output? Link to comment Share on other sites More sharing options...
KaFu Posted February 2, 2012 Share Posted February 2, 2012 WinWaitActive("7-Zip Dateimanager") WinWaitActive("Optionen") Those Window titles sound more German than Dutch to me (en ik spreek een beetje nederlands )... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
SirHaschke Posted February 2, 2012 Author Share Posted February 2, 2012 (edited) Thats correct, but the standard language in 7-Zip is german. After the AutoIt skript i chang it to netherlands via reg key. Edited February 2, 2012 by SirHaschke Link to comment Share on other sites More sharing options...
KaFu Posted February 2, 2012 Share Posted February 2, 2012 (edited) Maybe If StringInStr(@OSArch, "64") Then Run(StringLeft(@ProgramFilesDir, 3) & "Program Files (x86)7-Zip7zFM.exe") Else Run(@ProgramFilesDir & "7-Zip7zFM.exe") EndIf ? Edited February 2, 2012 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
SirHaschke Posted February 2, 2012 Author Share Posted February 2, 2012 Bingo. Run(@ProgramFilesDir & "7-Zip7zFM.exe") works fine. But why not Run("C:Program Files7-Zip7zFM.exe")? Thanks in advance. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 2, 2012 Moderators Share Posted February 2, 2012 SirHaschke, what is the output if you run the code below? MsgBox(0, "", @ProgramFilesDir) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
KaFu Posted February 2, 2012 Share Posted February 2, 2012 Afaik the directories are hardcoded for localized XP versions. MsgBox(0,"",@ProgramFilesDir) MsgBox(0,"",RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion","ProgramFilesDir")) On Win7 however I think localization is done via hard-links so that both the default "program files" and the localized version should be accessible. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
SirHaschke Posted February 2, 2012 Author Share Posted February 2, 2012 OK. The output is C:Program Files Thanks for your help. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 2, 2012 Share Posted February 2, 2012 Thats correct, but the standard language in 7-Zip is german.>_> Only on German machines. github.com/jvanegmond Link to comment Share on other sites More sharing options...
SirHaschke Posted February 2, 2012 Author Share Posted February 2, 2012 In my case it was a dutch machine. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 2, 2012 Share Posted February 2, 2012 I've tested on two Dutch machines and neither of them have German as the default setting for the 7-Zip installation. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Robjong Posted February 2, 2012 Share Posted February 2, 2012 (edited) I believe 7-Zip detects the system language, in which case you will have to change the strings in the script as well or change the language when the script is done. As an aside you might want to use the Control* functions instead of Send. I put together an example script which you could modify to install in one language and change it to another afterwords, or install in different languages on different sytems. Global Const $asStrings[4] = ['en', 'Options', '&Tools', '&Options...'] ; $aDE Global Const $sInstallDir = @ProgramFilesDir & "7-Zip" ; path to install directory Do ; close any opened instances of 7z Until Not ProcessClose("7z.exe") And Not ProcessClose("7zFM.exe") And Not ProcessClose("7zG.exe") RunWait("7z920.exe /S /D=""" & $sInstallDir & "") ; run the installer with the silent switch /S RegWrite("HKCUSoftware7-Zip", "Lang", "REG_SZ", $asStrings[0]) ; set language to 'en' for English, default = System Language Local $iPID = Run($sInstallDir & "7zFM.exe") ; run the filemanager Local $hWin = WinWait("[TITLE:7-Zip; CLASS:FM; INSTANCE:1]") ; wait until the window exists WinMenuSelectItem($hWin, "", $asStrings[2], $asStrings[3]) ; open options window Local $hWinOpts = WinWait("[TITLE:" & $asStrings[1] & "; CLASS:#32770; INSTANCE:1]") ; wait until the options window exists ControlClick($hWinOpts, "", "[CLASS:Button; INSTANCE:1]", "primary") ; click the select all button Sleep(300) ; give the changes time to take effect ControlClick($hWinOpts, "", "[CLASS:Button; INSTANCE:2]", "primary") ; click OK, applies changes and closes window Sleep(500) ; give the changes time to take effect ProcessClose($iPID) ; close file manager ;~ RegWrite("HKCUSoftware7-Zip", "Lang", "REG_SZ", 'de') ; write the final language code to the registry ;~ Run($sInstallDir & "7zFM.exe") ; open the file manager for the user? Edited February 2, 2012 by Robjong Link to comment Share on other sites More sharing options...
SirHaschke Posted February 3, 2012 Author Share Posted February 3, 2012 The installation is english. After that if i start the 7 Zip filemanager it is on a dutch machine german !! After that i import an reg key an then the language of 7Zip is dutch. Link to comment Share on other sites More sharing options...
Robjong Posted February 3, 2012 Share Posted February 3, 2012 (edited) In that case just set the language before you make the changes.Global $sInstallDir = @ProgramFilesDir & "7-Zip" ; path to install directory If StringInStr(@OSArch, "64") Then $sInstallDir = StringLeft(@ProgramFilesDir, 3) & "Program Files (x86)7-Zip" Do ; close any opened instances of 7z Until Not ProcessClose("7z.exe") And Not ProcessClose("7zFM.exe") And Not ProcessClose("7zG.exe") RunWait("7z920.exe /S /D=""" & $sInstallDir & "") ; run the installer with the silent switch /S RegWrite("HKCUSoftware7-Zip", "Lang", "REG_SZ", 'nl') ; set language to 'nl' for Dutch, default = System Language Local $iPID = Run($sInstallDir & "7zFM.exe") ; run the filemanager Local $hWin = WinWait("[TITLE:7-Zip; CLASS:FM; INSTANCE:1]") ; wait until the window exists WinMenuSelectItem($hWin, '', 'E&xtra', '&Opties...') ; open options window Local $hWinOpts = WinWait("[TITLE:Opties; CLASS:#32770; INSTANCE:1]") ; wait until the options window exists ControlClick($hWinOpts, "", "[CLASS:Button; INSTANCE:1]", "primary") ; click the select all button Sleep(300) ; give the changes time to take effect ControlClick($hWinOpts, "", "[CLASS:Button; INSTANCE:2]", "primary") ; click OK, applies changes and closes window Sleep(500) ; give the changes time to take effect ProcessClose($iPID) ; close file managerEdit: added the 64 bit part KaFu mentioned Edited February 3, 2012 by Robjong 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