karabey
18th May 2006 03:58 UTC
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...
Red Wine
18th May 2006 05:34 UTC
$PLUGINSDIR is removed once the installer is finished.
You're making shortcut to nowhere! :-)
Afrow UK
18th May 2006 09:16 UTC
I'm pretty sure "$PLUGINSDIR\MyFile.exe" should be "$INSTDIR\MyFile.exe"
-Stu
karabey
18th May 2006 23:10 UTC
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"
karabey
18th May 2006 23:18 UTC
Is there also a Plugin or a Command to pass htaccess logins?
Red Wine
19th May 2006 20:05 UTC
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.
karabey
19th May 2006 23:42 UTC
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?
Red Wine
20th May 2006 13:41 UTC
Isn't any way to pass htaccess login?
I have not idea, did you try search the forum?
karabey
21st May 2006 00:02 UTC
I dont know how i should search? I mean i dont know what command is used for it.