cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LindaT
Level 2

Replace line in iss file

Hi,

I have created a silent installation file for a third party application that I launch via our installation.
The szDir is hardcoded and points to C:\Program Files\...

I need to be able to modify that line according to whatever drive the user wants to install the program to.

So, the question is:
how can I replace a line (specifically the szDir= line...) in an .iss file?
I'm thinking bat script or similar, but if anyone has a better suggestion that's nice. I know the line in the .iss file but need to change the value to the current %programfiles% value.

Regards,
Linda
Labels (1)
0 Kudos
(3) Replies
thepeter
Level 7

You could build your path in the custom action by using a public property in your IS script.
If you send me the code behind your custom action I could show you how to.
0 Kudos
LindaT
Level 2

Thanks,

I just got a solution to the problem. I'll use a custom action where I run a bat script that echoes all lines to an .iss file.

Run e.g. file.bat > file.iss

Example content of file:
@echo off
echo [First line]
echo Second line
echo szDir=%PROGRAMFILES%\Company name


/Linda
0 Kudos
RogerMason
Level 2

Sorry to drag this old topic back up, but I was wondering if anyone else has any ideas for other solutions to this problem. I don't want to make an extra script to edit the contents of the .iss file but referring to the environment variable directly in the .iss file doesn't seem to work. Any help would be appreciated, thanks!
0 Kudos