Skip to content
⌘ NSIS Forum Archive

I don't understand anything

7 posts

Adelino Safeca#

I don't understand anything

Hey? my name is Adelino and newer working with NSIS tool.
I am trying to run a program .exe from a path file but when it starts to process returns me the error below:

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\Users\000455\Desktop\niss"

Processing script file: "C:\Users\000455\Desktop\niss\TESTE.exe" (ACP)
Invalid command: Â*
Error in script "C:\Users\Safeca\Desktop\niss\ESTE.exe" on line 2 -- aborting creation process

can any one tell me what's wrong?

thanks
JasonFriday13#
What version of nsis are you using?
What's the script command you are using to run the program?

You can't pass in a binary file into makensis, you have to make a script with either !system or !execute to run a program.
Adelino Safeca#
I'm using MakeNSIS 2.3.3 compiler, NSIS v3.01
Notepad++ to write the script then save as .exe.


Below the script in the notepad:

; Script generated by the HM NIS Edit Script Wizard.
*
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "TESTE"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "@Adelino"

*
SetCompressor lzma
*
!include "UserManagement.nsh"
*
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
*
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
*
; Language files
!insertmacro MUI_LANGUAGE "Portuguese"
*
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
*
; MUI end ------
*
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "TESTE.exe"
InstallDir "$PROGRAMFILES\RAMOSSOFT, TECNOLOGIAS"
ShowInstDetails show
*
Section -SETTINGS
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
SectionEnd
*
Section "JAVA JDK" SEC01
File "C:\Users\000222\Desktop\NovoProjecto\jdk-8u131-windows-x64.exe"
ExecWait "$INSTDIR\jdk-8u131-windows-x64.exe"
SectionEnd
*
Section "MySQL Connector" SEC02
MessageBox MB_OK \
"A seguir será instalado o connector ODBC do MySQL\
Por favor Click Ok para continuar \"

File "C:\Users\000222\Desktop\NovoProjecto\mysql-connector-odbc-5.3.8-win32.msi"
ExecWait "$INSTDIR\mysql-connector-odbc-5.3.8-win32.msi"

SectionEnd
Adelino Safeca#
You can't pass in a binary file into makensis, you have to make a script with either !system or !execute to run a program.[/QUOTE]

!system or !execute?

How can I do this?
Sorry... Help
JasonFriday13#
Ok, so now that you have posted some code I can actually help you out.

So the script you are writing in notepad, save it as a .nsi file. NSIS scripts are not executable files, so don't save them as .exe.

Also, remove the asterisks from the script. Those are causing the 'error on line 2' errors because that's invalid syntax.

It appears that you are running the files you want correctly (ExecWait). Just a pointer, nsis supports relative paths as well, so if you specify just a filename the compiler will look in the same directory as the script file. So you can use dos like paths: File /r "../temp/staged/*.*".

Also, if you want to use unicode characters in your script you have to save it as either UTF-8 or UTF-16LE/BE. HM NIS Edit is ansi only, so for unicode scripts it's better to use windows notepad or Notepad++. NSIS 3 supports unicode scripts as an input. If you want proper unicode support in your installer, use Unicode True in the script.

This should be enough to get you going.
Adelino Safeca#
Thanks for answering...
I did do what you said, but I still have the same problem!

script:

#Script generated by the HM NIS Edit Script Wizard.
*
# HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "TESTE"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "@Adelino"

SetCompressor lzma
*
!include "UserManagement.nsh"
*
# MUI 1.67 compatible ------
!include "MUI.nsh"
# MUI Settings
!define MUI_ABORTWARNING
*
# Welcome page
!insertmacro MUI_PAGE_WELCOME
# Components page
!insertmacro MUI_PAGE_COMPONENTS
# Instfiles page
!insertmacro MUI_PAGE_INSTFILES
# Finish page
!insertmacro MUI_PAGE_FINISH
*
# Language files
!insertmacro MUI_LANGUAGE "ENGLISH"
*
# Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
*
# MUI end ------
*
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "TESTE.exe"
InstallDir "$PROGRAMFILES\TESTE"
ShowInstDetails show
*
Section -SETTINGS
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
SectionEnd
*
Section "JAVA JDK" SEC01
File "C:\Users\000222\Desktop\NovoProjecto\jdk-8u131-windows-x64.exe"
ExecWait "$INSTDIR\jdk-8u131-windows-x64.exe"
SectionEnd
*
Section "MySQL Connector" SEC02


File "C:\Users\000222\Desktop\NovoProjecto\mysql-connector-odbc-5.3.8-win32.msi"
ExecWait "$INSTDIR\mysql-connector-odbc-5.3.8-win32.msi"

SectionEnd