CHDK Lua script environment (for Windows) - page 4 - LUA Scripting - CHDK Forum

CHDK Lua script environment (for Windows)

  • 37 Replies
  • 4712 Views
*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Lua script environment (for Windows)
« Reply #30 on: 04 / February / 2019, 04:51:38 »
Advertisements
I think I recognized the problem. :)

The error message (CHDK hostlua project not found!) appears when trying to start keypad.exe directly.

The correct procedure is:

Open npp.
Load a CHDK lua script of your choice.
Use one of the CHDK macro commands in the npp macro menu.
"CHDK LUA local keypad" is the right command for using the keypad.exe.

HTH

msl
CHDK-DE:  CHDK-DE links

Re: CHDK Lua script environment (for Windows)
« Reply #31 on: 04 / February / 2019, 10:22:30 »
I think I recognized the problem. :)
The error message (CHDK hostlua project not found!) appears when trying to start keypad.exe directly.

If I use the included Start Notepad++ shortcut, open a CHDK Lua script, and select the CHDK LUA local option from the Macro menu, the script will run until it needs one of the emulated CHDK functions (like new script headers) and the halt with an error.

If I use the included Start Notepad++ shortcut, open a CHDK Lua script, and select the CHDK LUA local keypad option from the Macro menu, the script will throw the CHDK hostlua project not found! error.

(Incidentally, Lua is not supposed to be capitalized - Lua not LUA )

I'm guessing that the config.cmd script is not doing the job properly.  My config.ini file is attached - does it look okay?

Update : successfully installed the same package on an older machine that has Win10 upgraded from Win7.  The config.ini files are the same on both machines. See my next post.
« Last Edit: 04 / February / 2019, 12:01:55 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: CHDK Lua script environment (for Windows)
« Reply #32 on: 04 / February / 2019, 11:39:57 »
Update :  If I run the config.cmd file as Administrator,  I get the an error popup window :

Windows Script Host
X Can not find script file
"C:\WINDOWS\system32\bin\config\config.vbs"

My (new) Win10 system does not even have a C:\WINDOWS\system32\bin folder, or a config.vbs file anywhere.

So this seems to be related to installing on a clean new Windows 10 system maybe?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Lua script environment (for Windows)
« Reply #33 on: 04 / February / 2019, 17:10:04 »
Thanks for the patient test.

Windows - the big mystery.  :haha

We successfully tested the configuration on various windows machines. The setup seemed fine.

The config.cmd should call the configuration script in hostluaPortable/bin/config and not in the Windows folder. Something is wrong here. I will ask @rudi.

msl
CHDK-DE:  CHDK-DE links


*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Lua script environment (for Windows)
« Reply #34 on: 08 / February / 2019, 09:08:57 »
We have found that under certain conditions the setup paths are not properly recognized. Following hints can help. An update will follow.

In general, the program should not be run as administrator. This is not the sense of a portable program.

Perhaps the security settings must be allowed to apply the hostluaPortable package.

To unzip use 7zip if possible. With Windows zip the unpacked folder must be allowed.

The hostluaPortable path should not contain any blank and special characters.

The hostluaPortable folder contains 3 cmd files:

config.cmd - first installation
update.cmd - all updates
stdeditor.cmd - set up notepad ++ portable as standard Windows editor (on/off)

All three files contain a path to a vbs script. In case of problems the path can be changed:
Instead of 'bin\config\...' use '%cd%\bin\config\...'

Run notepad++ portable incl. hostlua support via shortcut 'Start Notepad++'. It checks if libUSB is installed. If the driver is missing, a warning message is issued. You can still use the program.

msl
« Last Edit: 08 / February / 2019, 09:12:40 by msl »
CHDK-DE:  CHDK-DE links

Re: CHDK Lua script environment (for Windows)
« Reply #35 on: 11 / February / 2019, 11:00:31 »


We have found that under certain conditions the setup paths are not properly recognized. Following hints can help. An update will follow.

I've done/tried almost everything on the list - thanks for putting that together.

Perhaps the shortest route for now would be to manually configure things?  Is there a list of what needs to be done? Is it really just changing the three files that contain a path to a vbs script from 'bin\config\...' to '%cd%\bin\config\...'

Or should I study the code in the repository to figure out what else is needed ?



Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline rudi

  • ***
  • 126
  • A590IS_101B, SX260HS_100B
Re: CHDK Lua script environment (for Windows)
« Reply #36 on: 20 / February / 2019, 06:38:15 »
Hi waterwingz,

hostlua run with standard user privileges and normaly also the vbs script interpreter "wscript.exe". But some security suites or secure system configurations are blocking wscript.exe.

At first check is vbs code executing is starting up.
 
You can remove //nologo from config.cmd line 15. In this case you see the icon from wscript.exe on taskbar when configuration is running.
OR
You can insert MsgBox "begin configuration" to \bin\config\config.vbs after line 24. Then you get this message when configuration script is starting.

rudi

Re: CHDK Lua script environment (for Windows)
« Reply #37 on: 14 / March / 2019, 00:02:48 »
I'm still not entirely over with my plan to get hostlua run with an existing npp installation lol. I might be a bit compulsive about not having two versions of the same software on my computer 😂

Well while doing some googling on finding a good installer for a different project that I want to start, I came across the "Nullsoft scriptable installer system" found here: https://nsis.sourceforge.io/Main_Page

It looks pretty easy to start with and very versatile and might be a good tool to make a perfect installer for this. I think I'll give it a try and see how far I can get...


 

Related Topics