Old 23rd July 2017, 03:19   #1
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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
Adelino Safeca is offline   Reply With Quote
Old 23rd July 2017, 04:09   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 23rd July 2017, 09:13   #3
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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 is offline   Reply With Quote
Old 23rd July 2017, 10:29   #4
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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
Adelino Safeca is offline   Reply With Quote
Old 23rd July 2017, 19:09   #5
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 23rd July 2017, 20:19   #6
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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
Adelino Safeca is offline   Reply With Quote
Old 24th July 2017, 06:00   #7
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
You didn't remove the asterisks (*).

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 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