View Single Post
Old 3rd April 2020, 16:16   #1
Junior Member
Join Date: Aug 2018
Posts: 14
Can't execute a executable with exec


I try to execute a exe. I tried: nsExec::ExecToStack, nsExec::Exec, ExecWait, ExecShell. But I get each time as return value "error". So I don't know actually what the error could be.

But if I run the exe with cmd it works.


SetCompress auto
SetCompressor lzma
CRCCheck on
ManifestDPIAware true

; General

Unicode true
ManifestSupportedOS all

; Name and file
Name "Installer"

OutFile "Fortinet_Installer.exe"

; Request application privileges for Windows
RequestExecutionLevel admin

; Imports

!include LogicLib.nsh
!include WinVer.nsh
!include WordFunc.nsh
!include x64.nsh

; Variables

Var Platform

; Functions

Function .onInit

; CWD setzen
SetOutPath "$TEMP\Test-Installer"

${If} ${IsNativeAMD64}
StrCpy $Platform "x64"
File FortiClientVPNSetup_x64.exe
${ElseIf} ${IsNativeIA32}
StrCpy $Platform "x86"
File FortiClientVPNSetup_x86.exe
${ElseIf} ${IsNativeARM64}
; Install ARM64 64-bit driver/library
Abort "Unsupported CPU architecture!"
Abort "Unsupported CPU architecture!"

DetailPrint 'CPU architecture "$Platform" recognized.'

; Sections


DetailPrint '"Run $TEMP\FortiClientVPNSetup_$Platform.exe /quiet /norestart"'
nsExec::ExecToStack '"$TEMP\FortiClientVPNSetup_$Platform.exe" /quiet /norestart'
Pop $0
Pop $1
DetailPrint '"$0"'
DetailPrint '"$1"'


You could get the executable from here.
ikreb is offline   Reply With Quote