janedoe2003
1st January 2004 17:00 UTC
Couple of ?s about VB and NSIS
Hi,
1. I went through the FAQ and the archives, and found exemples on how to build a small, through-the-web installer to fetch the VB runtime from the web:
ExecShell "open" "http://www.whatever.com/downloadthis.exe"
=> How reliable is this? As I'm just starting with NSIS, does someone have a full script to install the VB runtime trough the web?
2. I'd like to write a routine in Sub Main() that will
- query a web app for all the dependencies for a given app (eg. www.acme.com/list.php?app=myapp -> get CSV-formatted list)
- for each and every dependendy, check that it's already installed
- if not, fetch it from the web
=> Can I use nsisdl.dll to perform this task from a VB app? Does someone have an example?
Thank you, and a happy new year
JD.
Joel
1st January 2004 17:26 UTC
Hello there:
1. It's reliable. :D
You'll have to use NSISdl for that... The Nsis Web archive has cool examples.
2. NSIS' Function .onInit is like VB's Form_Load() or Sub Main(). But NSIS is nothing like VB; although both are programming languages and have the same logic.
kichik
1st January 2004 17:39 UTC
I wouldn't rely on ExecShell. You can't wait for it like you can with ExecWait and nothing assures you the user hasn't set http:// handling to a browser that will allow the user to open the file. For example, Mozilla browsers just offer to save EXE somewhere for security reasons, at least the last time I use Mozilla.
As for the CSV file, I think an INI file would be simpler to manage. Instead of opening and parsing the file you'll only need to call ReadINIStr.
janedoe2003
1st January 2004 17:40 UTC
>>NSIS' Function .onInit is like VB's Form_Load() or Sub Main()
Thanks but... can I use nsisdl.dll from VB to automate the whole dependency check + download part instead of reinventing the wheel? Anybody has the DECLARE required to call it from VB?
Thank you
JD.
kichik
1st January 2004 17:42 UTC
I don't think it'd be easy to use NSISdl in VB. It would probably be easy to call a NSIS installer which will call NSISdl or just download using VB.
Joost Verburg
1st January 2004 17:45 UTC
You can also check the dependencies using NSIS. See the users manual for information about commands to check DLL versions.
janedoe2003
1st January 2004 20:07 UTC
Interesting... I hadn't thought about building an installer that could be called either explicitely for the initial install, or silently every time my app starts to delegate the checking + downloading of missing components or updates.
I'll see what I can do. Thanks :-)
JD.