Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Scite request - not show beta tools if beta not installed


  • Please log in to reply
8 replies to this topic

#1 Nutster

Nutster

    Developer at Large

  • Developers
  • 1,450 posts

Posted 07 January 2008 - 09:01 PM

I was running Scite with 3.2.10.0 and no Beta version installed. Under the Tools menu, I saw all sorts of beta tools as well. Could Scite menu be altered so that when the Beta is not installed, all the beta stuff does not show up?

David Nuttall

Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius
AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...








#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 07 January 2008 - 10:12 PM

Maybe a clever Lua script could overwrite the properties to destroy them. Just an idea for Jos to maybe try to pursue.

#3 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,355 posts

Posted 07 January 2008 - 10:21 PM

Maybe a clever Lua script could overwrite the properties to destroy them. Just an idea for Jos to maybe try to pursue.

Have already tried that but don't know a howto remove the properties.
Normally when you change for example:
command.name.0.$(au3)=Beta Run

to
command.name.0.$(au3)=
The entry will be gone from the tools menu, but when doing this in LUA:
    --Check for Beta     f = io.open(props["autoit3dir"].."\\beta\\au3check.dat")     if f ~= nil then         -- Beta Exists         f:close()     else         -- No Beta Directory         props['command.name.0.' .. props['au3']] = ""     end

It doesn't remove the entry...... Tried setting it to one space and nil but none work correctly.
So the only way I can think of at the moment is to actually update the au3.properties file lines like SciTEConfig does to remove tools.

Edited by Jos, 07 January 2008 - 11:07 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#4 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 07 January 2008 - 10:43 PM

Jos, there's another solution...

You can use simple conditional code in properties files. Here's an example of my properties file:
Plain Text         
# Only one of these can be define at a time.  Define to the currently in-use # version of AutoIt.  If both are set, then beta will take precedence. STABLE_AUTOIT=1 BETA_AUTOIT=0 # ... # Import the keyword lists for both stable and beta. import properties\au3.keywords.stable import properties\au3.keywords.beta # ... # We are using stable AutoIt. if STABLE_AUTOIT     # Set Au3Dir to the AutoIt directory.  This variable is used outside the if.     Au3Dir=D:\Program Files\AutoIt3     # Load the stable API file.     api.$(au3)=$(SciteDefaultHome)\api\au3.stable.api     # AutoIt Keyword Lists     keywords.$(au3)=$(au3.keywords.keywords.stable)     keywords2.$(au3)=$(au3.keywords.functions.stable)     keywords3.$(au3)=$(au3.keywords.macros.stable)     keywords4.$(au3)=$(au3.keywords.sendkeys.stable)     keywords5.$(au3)=$(au3.keywords.preprocessor.stable)     keywords6.$(au3)=$(au3.keywords.special.stable)     keywords8.$(au3)=$(au3.keywords.udfs.stable) # We are using beta AutoIt. if BETA_AUTOIT     # Set Au3Dir to the AutoIt directory.  This variable is used outside the if.     Au3Dir=D:\Program Files\AutoIt3\beta     # Load the beta API file.     api.$(au3)=$(SciteDefaultHome)\api\au3.beta.api     # AutoIt Keyword Lists     keywords.$(au3)=$(au3.keywords.keywords.beta)     keywords2.$(au3)=$(au3.keywords.functions.beta)     keywords3.$(au3)=$(au3.keywords.macros.beta)     keywords4.$(au3)=$(au3.keywords.sendkeys.beta)     keywords5.$(au3)=$(au3.keywords.preprocessor.beta)     keywords6.$(au3)=$(au3.keywords.special.beta)     keywords8.$(au3)=$(au3.keywords.udfs.beta)

My setup lets me switch between Stable API/Properties files by just changing 2 flags around (which you see). I can also enable or disable my custom wrapper by another flag (not present). You could do similar stuff. Then SciTEConfig could just change a flag instead of do heavy file modification. Also, the version of AutoIt Extractor I'm working on supports generating files and properties with the names you see above. It'll support multiple INI files so you'll be able to run it twice, once with a stable INI file, once with a beta INI file and it'll generate separate API and keyword.properties files. It's all really nice once set up and requires minimal effort on my part to change. If you are interested, I can show you the entire properties file via PM.

#5 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,355 posts

Posted 08 January 2008 - 09:15 AM

Will have a look at this approach but its a shame that we can't do it dynamically using the approach I posted earlier ... Don't really like modifying au3.properties with the issues Vista could give ....

Jos

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#6 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 08 January 2008 - 03:33 PM

Honestly Jos, SciTE is poorly designed to handle Vista and that's not really our fault. But, it should be possible to configure SciTE to load the properties file from anywhere on the system. Just need to figure out a good place to store them. It would be nice to use %APPDATA%\SciTE to store properties/Lua files. However, SciTE doesn't have a pre-defined property for that path. On the other hand, SciTE does claim to support environment variables as properties, so, it could be possible to do.

#7 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,355 posts

Posted 09 January 2008 - 08:21 PM

Assuming the plan to change the access rights on the SciTE directory is implemented, I got it working doing it this way in LUA using the conditional properties as shown:

Plain Text         
    -- Check for Beta and set the BETA_AUTOIT= in au3.properties to the correct value     f = io.open(props['autoit3dir'].."\\beta\\au3check.dat")     self.Beta = '0'     if f ~= nil then         -- Beta Exists         f:close()         self.Beta = '1'     end     -- check if au3.properties needs to be changed     if  props['BETA_AUTOIT'] ~= self.Beta then         print("Need to change au3.properties: BETA_AUTOIT = " .. self.Beta)         f = io.open(props['SciteDefaultHome'].."\\properties\\au3.properties")         if f ~= nil then             self.au3propinfo = f:read('*a')             f:close()             -- update the setting for BETA_AUTOIT             self.au3propinfo = string.gsub(self.au3propinfo,"BETA_AUTOIT=%d","BETA_AUTOIT=" .. self.Beta)             f = io.open(props['SciteDefaultHome'].."\\properties\\au3.properties","w")             f:write(self.au3propinfo)             f:close()             props['BETA_AUTOIT'] = self.Beta             -- Trigger reload of the properties             scite.Open(props['SciteDefaultHome'].."\\properties\\au3.properties")             scite.MenuCommand(IDM_SAVE)             scite.MenuCommand(IDM_CLOSE)         end     end


This seems to be working fine till now.

:)

Edited by Jos, 09 January 2008 - 08:21 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#8 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,355 posts

Posted 11 January 2008 - 07:57 AM

Implemented in the latest Beta version of SciTE4AutoIt3 :)

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#9 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 11 January 2008 - 11:53 PM

Moving this to the Complete sub-forum since... well, it's complete.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users