You are here

How to download and unzip?

4 posts / 0 new
Last post
5keeve
Offline
Last seen: 9 years 11 months ago
Joined: 2012-07-12 15:13
How to download and unzip?

As I'm not allowed to include the binary in my DbVisualizer Launcher, I thought about downloading the binary when the installer is started.

At the moment I have the code shown at the bottom.

Now just before the "Delete $2" I need to unzip the downloaded zip file to %PAL:AppDir%

As I did not understand NSIS yet, can anyone please give me a hint how to achieve this?

I thing I need some unzip plugin for nsis, like http://nsis.sourceforge.net/NsUnzip_plugin but don't know how to properly include this with my installer.

!define DBVIS_VERSION "9.1.11" 
!define DBVIS_URL "http://www.dbvis.com/product_download/dbvis-9.1.11/media/dbvis_windows_9_1_11.zip"

Function CustomCodePreInstall
        MessageBox MB_OK "${PRODUCT_NAME} needs to download DbVisualizer ${DBVIS_VERSION}"
FunctionEnd

Function CustomCodePostInstall
        StrCpy $2 "$TEMP\dbvis.zip"
        nsisdl::download /TIMEOUT=30000 ${DBVIS_URL} $2
        Pop $R0 ;Get the return value
                StrCmp $R0 "success" +3
                MessageBox MB_OK "Download failed: $R0"
                Quit
        ExecWait $2
        Delete $2
FunctionEnd

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 month 3 weeks ago
DeveloperModerator
Joined: 2008-07-24 18:46
Custom code not needed

You don't need custom code for this. Use the download files section in installer.INI instead: https://portableapps.com/development/portableapps.com_format#installer

5keeve
Offline
Last seen: 9 years 11 months ago
Joined: 2012-07-12 15:13
You're my hero! How could I

You're my hero! Biggrin

How could I have missed that?

Thanks a million times.

5keeve
Offline
Last seen: 9 years 11 months ago
Joined: 2012-07-12 15:13
Again thanks for that, but

Again thanks for that, but now I have the problem that the download fails. It seems the installer does not know about any proxy settings.

"The installer was unable to download... (Error: SendRequest Error)"

Am I missing something?

Update: I changed PortableApps proxy settings to use a local port where a putty connection is telling me when a connection attempt is made.

When I let PortableApps check for updates I see a connection comming. When I use my installer, no connection can be seen.

Log in or register to post comments