Jump to content
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

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 

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

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

 

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

  • Similar Content

    • 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
    • By Beege
      If you have every taken the time to set up a nice dark theme for your scite editor, you probably noticed shortly after a small yet really annoying flaw. For what ever reason, scite is not set up to let you change the caret fore color and caret line color per language. This really sucks if say you want to edit a properties file or any of the many other languages that Scite currently is setup to support. Pretty much all the other languages are set as light theme so unless you change the theme for those file types, you end up with something like below where the line color and caret are still using the dark theme colors. Line 3 in the pic:
       

       
      To get around this I came up with the following that seems to work pretty well.  
       
      Add the following properties to SciteUser.properties file (Options -> Open User Options File). Update colors to your own needs. You can addionally add any other propertys that dont have a lexer language option in the same fashion.
      # The default values (light themes) will be used for any lexer other than au3 caret.default.fore=#000000 caret.default.line.back=#FFFED8 selection.default.fore=#006000 selection.default.back=#F0A0A8 caret.au3.fore=#FFFFFF caret.au3.line.back=#111111 selection.au3.fore=#C2FFAE selection.au3.back=#f9f9f9  
      Add the following function to PersonalTools.Lua file. As jos pointed out, the OnStartup covers the filetab switches as well as the startup so only need the one function:
      function PersonalTools:OnStartup() -- the "and" + "or" keywords are ternary operators here local sLex = self:IsLexer(SCLEX_AU3) and 'au3' or 'default' props['caret.line.back'] = props['caret.' .. sLex .. '.line.back'] props['caret.fore'] = props['caret.' .. sLex .. '.fore'] props['selection.fore'] = props['selection.' .. sLex .. '.fore'] props['selection.back'] = props['selection.' .. sLex .. '.back'] end
      Last restart SciTE and that should be it. Let me know if you have any issues. Thanks
       
    • By ozymandius257
      Is there a way to remove the numbers from the tabs in Scite?
      When you have multiple autoit programs open, the tabs are numbered, so you'll get something like 1 ProgramA.au3    2 Program2.au3   3 Program3.au3
      I am working on programs with numbers as the first character, so I get  1 3-DoThis.au3     2 4-DoAnother.au3   3 5-DoTheRest.au3  (not the real program names, obviously :))
      It would be nice if I could get rid of the tab number, and just have the program name on each tab.
       
       
    • By SgtHugoStiglitz
      HI people,
                        I got a questions, I maintain code in autoIT and every time I compile a new version or modification, Scite generate 2 folders. One folder is finish by released and the other is tentative. I try to make some google search, but never find answer would satisfied myself. The dev who was maintain it before were using AutoIt3Wrapper_GUI, and I don't know if it's related. I look both folder, but they seem pretty identical, but I would like to know what it's the difference between those to folder. Anyone have a clue?
    • By user4157124
      ConsoleWrite('>Message here.' & @CRLF) outputs colored text (per + > - ! characters).
      ConsoleWrite('warning' & @TAB & '38' & @TAB & 'more text ...' & @CRLF) enables jump to line 38 on doubleclick.

      Using "jump to line" format, only red and pink text coloring seems possible (simply prefixing color directives to output-text disables jump to line functionality). Is it possible to combine the two (define custom color while keeping "jump to line" functionality)?
×
×
  • Create New...