cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
ninjadonkey
Pilgrim

IA places a return at the end of the variable.

I ran into an issue when I created an IA var with the "Execute Script/Batch file" action.

I pull the first 7 digits of the computer-name and use that IA var to replace a string in a file.
[I]Pre Install
--Execute Script
----echo off
----echo %computername:~0,7%
------store process's stdout in: $TRAILER_NUM$

Install
--Modify Text File
----replace "UGT001-" with "$TRAILER_NUM$"


I viewed the file in windows text editor and it looks fine.


I used "Beyond & Compare" to check the difference between a working file and noticed that IA puts a return at the end of the string it replaces.



I used the display message panel and verified that it adds the return. I use the "%computername:~0,7%" in batch files to modify the same text files without issue. Is there an easier way to do this?

Thanks,
Kaine
Labels (1)
0 Kudos
5 Replies
Nipul_Patel
Pilgrim

Re: IA places a return at the end of the variable.

Hi,

I faced similar issue..

In Pre Install

Add action SET INSTALLANYWHERE VARIABLE - Single Variable: $MY_VARIABLE$ = $TRAILER_NUM$

I had tried in one of my projects and it worked..



ninjadonkey wrote:
I ran into an issue when I created an IA var with the "Execute Script/Batch file" action.

I pull the first 7 digits of the computer-name and use that IA var to replace a string in a file.
[I]Pre Install
--Execute Script
----echo off
----echo %computername:~0,7%
------store process's stdout in: $TRAILER_NUM$

Install
--Modify Text File
----replace "UGT001-" with "$TRAILER_NUM$"


I viewed the file in windows text editor and it looks fine.


I used "Beyond & Compare" to check the difference between a working file and noticed that IA puts a return at the end of the string it replaces.



I used the display message panel and verified that it adds the return. I use the "%computername:~0,7%" in batch files to modify the same text files without issue. Is there an easier way to do this?

Thanks,
Kaine
0 Kudos
ninjadonkey
Pilgrim

Re: IA places a return at the end of the variable.

Nipul Patel wrote:
Hi,

I faced similar issue..

In Pre Install

Add action SET INSTALLANYWHERE VARIABLE - Single Variable: $MY_VARIABLE$ = $TRAILER_NUM$

I had tried in one of my projects and it worked..


Thanks for the reply, but it didn't work.

This is honestly the worst forum to get questions answered, this will be the last year using InstallAnywhere.
0 Kudos
pv7721
Flexera beginner

Re: IA places a return at the end of the variable.

Have you given a thought to contacting the Flexera Software support directly?
0 Kudos
rakesh_dama
Active participant

Re: IA places a return at the end of the variable.

I feel the same. I am also planning to get rid of IA in my project.

0 Kudos
Flexera Flexera_Ian
Flexera

Re: IA places a return at the end of the variable.

Hi @ninjadonkey,

Thank you for your post. Sorry about the delayed response and your frustration.

I agree that it would be best to open a new support ticket for this issue. If you have not already done so, could you please open a new support ticket for this issue?

Thanks,

Ian

0 Kudos