Jump to content
Excelsior Forums

Recommended Posts

Hello

I am newbie with Excelsior and thus new in this forum. On top of that I am not so comfortable with Microsoft Windows. However, after only a short while I managed to create a "near perfect" installer with Excelsior ;o). The only task left is to add 'C:\Program\MyApp\bin' to the PATH variable!?!?!

Any help would be very much appreciated.

Johan

Share this post


Link to post
Share on other sites

Dear Johan,

Sorry for our slow reaction time.

Current version of our installers have not direct support of PATH variable manipulation.

As a workaround, you can export your project into NSIS scripts and customize scripts.

Please read the article "Path Manipulation" from NSIS web-site http://nsis.sourceforge.net/Path_Manipulation for details.

Probably you will prefer to customize templates of NSIS scripts to avoid patching the generated scripts everytime.

1. Please visit http://nsis.sourceforge.net/Path_Manipulation and copy the content of section 6.3 "The Functions" into new file named "AddToPath.nsh". The content of the "AddToPath.nsh" file should begin with

!ifndef _AddToPath_nsh
!define _AddToPath_nsh

and end with

	
!endif ; _AddToPath_nsh

2. Copy created "AddToPath.nsh" file into "Excelsior Delivery 2.2\nsis" folder.

3. Open "Excelsior Delivery 2.2\nsis\eit.nsi" file and insert the line

	
!include "AddToPath.nsh"

just after the line

	
!include "FileFunc.nsh"

4. To add location of installation folder to PATH environment variable at install time, find in the "eit.nsi" file the line:

	
@POSTINSTALL_ACTION_RUN_ALWAYS

and insert the following lines just before it:

	
Push $INSTDIR
Call AddToPath

5. To remove location of installation folder from PATH environment variable, find in the "eit.nsi" file the line:

	
SectionEnd ; Uninstaller Section

and insert the following lines just before it:

	
Push $INSTDIR
Call un.RemoveFromPath

That's all. After all manipulations "eit.nsi" should looks like;

	
; -----------------------------------------------------------------------------
; The installation script based on NSIS modern user interface
; -----------------------------------------------------------------------------

@PACKAGEINFO
. . .
!include "LogicLib.nsh"
!include "FileFunc.nsh"
!include "AddToPath.nsh"
. . .

; -----------------------------------------------------------------------------
; Installer Sections

Section "Installer Section"
. . .

 Push $INSTDIR
 Call AddToPath

@POSTINSTALL_ACTION_RUN_ALWAYS
. . .

SectionEnd ; Installer Sections
. . .

; -----------------------------------------------------------------------------
; Uninstaller Section
Section "un.Uninstaller Section"
. . .

 Push $INSTDIR
 Call un.RemoveFromPath
SectionEnd ; Uninstaller Section


; -----------------------------------------------------------------------------
; Customization of uninstall NSIS callbacks
Function un.onInit

@DESIRED_LANGUAGE

FunctionEnd

You can find "AddToPath.nsh" and patched "eit.nsi" in the attachment of this post.

To export your project, open it with Ecelsior Installer or Delivery and select File -> Export to NSIS in the main menu.

As a alternative, you can try beta version of Excelsior Delivery. This version provides special API to request Excelsior Delivery to modify System registry and environment variables at install and uninstall time. This API is available via callback DLL.

The beta version of Excelsior Delivery 2.3 is available to download by the following link http://www.excelsior.ru/downloads/eit-230-beta-en-win32.exe

 

File "Excelsior Delivery 2.3\include\eit.h" defines the Excelsior Toolkit API. Sample "Excelsior Delivery 2.3\samples\ToolkitAPI" shows how to use Excelsior Installation Toolkit API to manipulate with PATH environment variable.

With best regards,

Kostya

nsis-eit.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×