Skip to content
⌘ NSIS Forum Archive

autorun/autostart

6 posts

emiste7#

autorun/autostart

Hi,
Im looking for autostart or autorun function in NSIS.
Once i put in the CD with that EXE file, i need it to autorun or autoinstall without human been intervention.
kichik#
This thread should help you make it autostart from the CD:

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


To make it silent see SilentInstall in the documentation.
Brummelchen#
very short:

[autorun]
OPEN=path\cdstart.EXE
ICON=path\logo.ICO

script
; The name of the installer
Name "cdstart"

; The file to write
OutFile "cdstart.exe"

; closes the window after running
AutoCloseWindow true

; The stuff to install
Section "" ;
; your stuff here
;example: open windows explorer here
Exec '$windir\explorer.exe $exedir'

SectionEnd ; end the section
😉
emiste7#
Ok let me see if I understood:


OutFile "MyAutorun.exe"

!include "${NSISDIR}\Contrib\System\System.nsh"

Section -
StrCpy $1 "c:\"
System::Call '${sysGetDriveType}(r1) .r0'
DetailPrint "Boo: $1 $0"
IntCmp $0 5 0 notcddrive
MessageBox MB_OK "Drive $1 is a cd drive"
notcddrive:
SectionEnd

Solved CD Auto PLay
Code:

; save this part as autorun.inf
; this is it to autorun EXE files
[autorun]
; the executable must be in root Cd drive
open=install.exe
icon=whatever_icon_you_want.ico

Now another question:
I need to write this code in the "section" after .nsh or i can write everywhere???

Thank you