Scite request - not show beta tools if beta not installed
#1
Posted 07 January 2008 - 09:01 PM
#2
Posted 07 January 2008 - 10:12 PM
#3
Posted 07 January 2008 - 10:21 PM
Have already tried that but don't know a howto remove the properties.Maybe a clever Lua script could overwrite the properties to destroy them. Just an idea for Jos to maybe try to pursue.
Normally when you change for example:
command.name.0.$(au3)=Beta Run
to
command.name.0.$(au3)=
--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
Posted 07 January 2008 - 10:43 PM
You can use simple conditional code in properties files. Here's an example of my properties file:
# 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
Posted 08 January 2008 - 09:15 AM
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
Posted 08 January 2008 - 03:33 PM
#7
Posted 09 January 2008 - 08:21 PM
-- 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
Posted 11 January 2008 - 07:57 AM
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#9
Posted 11 January 2008 - 11:53 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




