Archive: Create Shortcut and RUN exe after UNZIP


Create Shortcut and RUN exe after UNZIP
Hi,

How can i make for this Script a Shortcut for Desktop and start from the extracted Folder the EXE File and the end of the installer?


;--------------------------------
;Include Modern UI

!include "MUI.nsh"


;--------------------------------
;General

; The name of the installer
Name "InetLoad Test"
OutFile "InetLoad.exe"
InstallDir $PROGRAMFILES\InetLoad

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Pages & Languages

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!define MUI_FINISHPAGE_RUN "$INSTDIR\MyFile.exe"

;SilentInstall silent
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy

InitPluginsDir
NSISdl::download http://www.mydomain.com/myfile.zip "$PLUGINSDIR\myfile.zip"
Pop $R0 ;Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0"
Quit

nsisunz::UnzipToLog "$PLUGINSDIR\myfile.zip" "$INSTDIR"
Pop $R0
StrCmp $R0 "success" +2
DetailPrint "$R0" ;print error message to log

CreateShortCut "$DESKTOP\MyFile.lnk" "$PLUGINSDIR\MyFile.exe"

SectionEnd


The Failure is here but how can i resolve it?

!define MUI_FINISHPAGE_RUN "$INSTDIR\MyFile.exe"
CreateShortCut "$DESKTOP\MyFile.lnk" "$PLUGINSDIR\MyFile.exe"



Thx for every help...

$PLUGINSDIR is removed once the installer is finished.
You're making shortcut to nowhere! :-)


I'm pretty sure "$PLUGINSDIR\MyFile.exe" should be "$INSTDIR\MyFile.exe"

-Stu


The Shortcut is created like this

C:\Programme\Inetload\MyFile.exe

But if i open the Folder Inetload so there is another Folder from the Unzipped File called "MyFilev1.2"

The Shortcut should be created as

C:\Programme\Inetload\MyFilev1.2\MyFile.exe

The Command "$INSTDIR\MyFile.exe" doesnt help me cause if a newer Version is out so there will be created another Folder with "MyFilev1.3"


Is there also a Plugin or a Command to pass htaccess logins?


Well, if the "myfile.exe" holds version info, you may use FindFirst/FindNext to search for newest version inside "C:\Programme\Inetload" and create the shortcut pointing to it. Or better, you may use ${Locate}. See NSIS documentation for all available solutions. In every case your code should look like:
Find the file,
get and compare its version with a defined version,
find the next one and compare with previous and defined,
find the newest, grab its path and create the shortcut.


Woww thx Red Wine... Its easy for a beginner to explain.. But doing is little bit hard.. Well i will start as first with ${Locate}.

Isn't any way to pass htaccess login?


Isn't any way to pass htaccess login?
I have not idea, did you try search the forum?

I dont know how i should search? I mean i dont know what command is used for it.