ChangeDirectory Example

InstallShield 2016 » InstallScript Language Reference

Note • To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

/*-----------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the ChangeDirectory function.

*

* This example script makes the Windows folder the current

* directory and then launches NotePad to display the file

* Readme.txt.

*

\*-----------------------------------------------------------*/

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

 

    export prototype ExFn_ChangeDirectory(HWND);

 

function ExFn_ChangeDirectory(hMSI)

begin

 

// Make the Windows folder the default directory.  Note that

// the InstallShield system variable WINDIR points

// to the Windows folder.

 

 

ChangeDirectory (WINDIR);

// Launch Notepad to view the Windows Readme.txt file.

   LaunchApp ("Notepad.exe", "Readme.txt" );

 

end;