Old 18th May 2006, 02:58   #1
karabey
Junior Member
 
Join Date: May 2006
Posts: 13
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?


code:
;--------------------------------
;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?

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




Thx for every help...
karabey is offline   Reply With Quote
Old 18th May 2006, 04:34   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
$PLUGINSDIR is removed once the installer is finished.
You're making shortcut to nowhere! :-)

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 18th May 2006, 08:16   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I'm pretty sure "$PLUGINSDIR\MyFile.exe" should be "$INSTDIR\MyFile.exe"

-Stu
Afrow UK is offline   Reply With Quote
Old 18th May 2006, 22:10   #4
karabey
Junior Member
 
Join Date: May 2006
Posts: 13
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 is offline   Reply With Quote
Old 18th May 2006, 22:18   #5
karabey
Junior Member
 
Join Date: May 2006
Posts: 13
Is there also a Plugin or a Command to pass htaccess logins?
karabey is offline   Reply With Quote
Old 19th May 2006, 19:05   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 19th May 2006, 22:42   #7
karabey
Junior Member
 
Join Date: May 2006
Posts: 13
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?
karabey is offline   Reply With Quote
Old 20th May 2006, 12:41   #8
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
Isn't any way to pass htaccess login?
I have not idea, did you try search the forum?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 20th May 2006, 23:02   #9
karabey
Junior Member
 
Join Date: May 2006
Posts: 13
I dont know how i should search? I mean i dont know what command is used for it.
karabey is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump