Jump to content
Sign in to follow this  
rudi

Autoit SciTE silent install with "Default = Edit"

Recommended Posts

Hello,

very propably this has been asked before, well, I miss the thread(s) ...

Is there a command line switch to tell the SciTE setup EXE to install silently ("/S") *AND* to end up with "edit" (instead of "run") as system wide default action for *.au3 files?

 

:huh:

 

As it can be done with the config tool:

https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/SciTEConfigb1.PNG

 

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

The installer doesn't  have any logic for the default action for "AU3" files as this is done by the AutoIt3 instller.
When you use a script to install SciTE you could the registry updates as done by SciTEConfig:

To set the default action to "Open" (Use SciTE.exe):

RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Open')
RegWrite('HKEY_CLASSES_ROOT\AutoIt3ScriptBeta\Shell', '', 'REG_SZ', 'Open')

Te Set the default to "Run" (Open with AutoIt3.exe) :

RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Run')
RegWrite('HKEY_CLASSES_ROOT\AutoIt3ScriptBeta\Shell', '', 'REG_SZ', 'Run')

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks Jos.

This requires registry actions after the install. Do you see any chance to "pass" a command line option like "/S" for silent to the installer package, so that it would be able by using just command line swiches for some future release?

 

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Understood, as the installer would have to do that too. This is an NSIS installer so guess anything is possible when we want, but how are you performing this silent install?
Can't you simply add that registry change to that process which shells the SciTE installer?

Jos 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hello Jos,

thanks for pointing out "NSIS".

Of course I can place the registry keys to the PC after the install is done, but with one command line would be a nice feature.

Q: ...  but how are you performing this silent install?

A: For a silent install I use the " /S" as a command line parameter. (An info from you, IIRC???)

 

 

I'll try to figure out, if this is a start to "transfer" the "request" to write the two registry keys to the NSIS installer:

 

http://nsis.sourceforge.net/Docs/Chapter4.html#registry

4.9.2.16 WriteRegStr

root_key subkey key_name value

Write a string to the registry. See WriteRegExpandStr for more details.

WriteRegStr HKLM "Software\My Company\My Software" "String Value" "dead beef"

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
1 hour ago, rudi said:

Q: ...  but how are you performing this silent install?

A: For a silent install I use the " /S" as a command line parameter. (An info from you, IIRC???)

This is a standard feature in NSIS (like most installer utilities: http://nsis.sourceforge.net/Docs/Chapter4.html#silent

When you are considering wrapping the installer with your one NSIS installer, it should be fairly easy to do so.
When you want, I can provide you a basic NSIS config source file to these 2 actions.
Just let me know and I'll have a look this evening.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hi Jos,

yes, this would be really great!

 

TIA, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Here you go...  Copy this source into a *.nsi file and store it in the same directory as the standard SciTE4AutoIt3 installer.
Compile this *.nsi file with NSIS and you should have an installer that runs silent and start the SciTE4AutoIt3 with /S  and then updates the registry to Edit.

Ask if anything is unclear. :)

Jos

; Script generated by the HM NIS Edit Script Wizard.
SetCompressor /SOLID lzma
; Script generated by the HM NIS Edit Script Wizard.
!define PRODUCT_NAME "SciTe4Autoit3 silent install wrapper"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "Jos van der Zande"
!define PRODUCT_WEB_SITE "http://www.autoitscript.com/autoit3/scite"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------
SilentInstall silent
Section "MainSection" SEC01
  SetOverwrite on
  SetOutPath "$TEMP"
  File "SciTE4AutoIt3.exe"
  DetailPrint "*** Running installer  ***"
  ExecWait '"$TEMP\SciTE4AutoIt3.exe" /S'
  DetailPrint "*** set Edit as default for .au3  ***"
  WriteRegStr HKCR "AutoIt3Script\Shell\" "" "Edit"
  WriteRegStr HKCR "AutoIt3ScriptBeta\Shell\" "" "Edit"
  DetailPrint "*** Installer done  ***"
  sleep 2000
  delete "$TEMP\SciTE4AutoIt3.exe"
SectionEnd

Section -Post
SectionEnd

 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Bhooshan
      I need to mute an ongoing call on Microsoft teams without activating the window. Teams allows us to mute using shortcut key Ctrl+Shift+m but only when the window is active.
      # Used set option as ongoing call can be with any person which leads to change in Title Name.
      AutoItSetOption ( "WinTitleMatchMode", 2 ) 
      # I am not clear with the control ID which will be good to use here and also the key combination of ^M       
      ControlSend ( "Microsoft Teams", "", "[CLASS:Intermediate D3D Window; INSTANCE:1]", "{ctrl down}")
       
      Can anyone help...!!! 
       

    • By Sayed
      Hi there, 
      I'm new in AutoIt forms and using AutoIt to automate desktop application (able to automate the application normally but facing issue when I've to re-run the application twice within the same script...so need help in this please)
      here is the steps then followed by the issue in a brief : 
      1- run application . 
      2- do some actions (click menus,activate windows,set texts..)
      3- close the application. 
      4- run the application again & access the same controls.
      5- open the same windows again (like step 2)
      6- perform some validations (by getting texts from some text boxes)
      7- close the application again (and repeat 1-7 for 15 times in average )
      The issue 
      * all controls are accessible in the first run and actions done successfully on controls (for steps 1-3) BUT from the second run of the application from step-4 it's able to set focus only the main application window.
      Note: only unique properties used to while mapping the controls. 
      Error that appear in the console :
      UIAWrappers.au3" (1673) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $x = Int($t[1] + ($t[3] / 2)) $x = Int($t[1] + (^ ERROR  
      Simple spy code  of one of the controls that has this strange issue(menubar&view menu Item): 
      ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=XXX;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app") ;main app form xxx _UIA_setVar("oP2","Title:=menuStrip1;controltype:=UIA_MenuBarControlTypeId;class:=WindowsForms10.Window.8.app") ;menuStrip1 ;~ $oUIElement=_UIA_getObjectByFindAll("View.mainwindow", "title:=View;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=View;controltype:=UIA_MenuItemControlTypeId;class:=") ;ControlType:=UIA_MenuItemControlTypeId;classname:=") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click")  
       
    • By Fenzik
      Hello All!
      i suggest to set default encoding in Scite4 for Autoit 3 to UTF 8 with Bom encoding, format recommended also in Autoit Help.
      In last editor version, when i open new script, for example Czech characters (č, ř, ž) aren't correct.
      So when i change Encoding to UTF 8 with Bom from Default Code page property state, everithing seems to be OK.
      Thank you and sorry for potentialy duplicated content.
      Fenzik
    • By jitb
      I have an eof problem in SciTE. I keep gitting this knitsu at the end of the open sesion.
      Please see below. The file should end at line 1220 but has invisable lines. What am I doing wrong?
    • By AutoitMike
      Scite 3.4.4
      Win 10
      I click "Help" or press F1, there is no response
      If I use the file explorer and double click Autoit.chm or Autoit3.chm help opens.
      There is no dialog to check or uncheck "Always ask before opening this file" when clicking on these files.
       
      If you are curious as to why I dont have the latest version, I am creating a back up laptop that has a VERY extensive automation application that I have written over the past 15 years.
       
      An extremely potent, powerful, needed function has been deleted in the upgrade of Autoit in recent years that I can not do without. If my main laptop dies, which it almost did, I am in a very bad position. So I bought the exact same laptop and I am "cofiguring" it to work exactly the same as my main laptop. However, this one has been "Upgraded" to Win 10 which I hope is not the problem. 
      Thanks for any help
×
×
  • Create New...