cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rolf_wey
Level 3

Setting 'Target' of an ini-file to [COMPUTERNAME]

Hello everyone,

in my Basic MSI Project I inserted an ini-file in the 'INI File Changes' view.
On the target system the ini-file should be created in a subfolder of the [INSTALLDIR]. Subfolders name should be the name of the computer. So I set the 'Target'-property of the ini-file to '[INSTALLDIR]blabla\[COMPUTERNAME]'. At runtime the installer created the folder '...\blabla\[COMPUTERNAME]'. I was hoping to find a folder '...\blabla\rwe-pc', because the name of the computer was 'rwe-pc'.

I also tried to set the 'Target' property of the ini-file to

  • '[INSTALLDIR]blabla\%COMPUTERNAME%'
  • '[INSTALLDIR]blabla\[%COMPUTERNAME%]'


and so on, nothing helps.

If anyone knows to resolve the problem please let me know.
Labels (1)
0 Kudos
(4) Replies
Dan_Galender
Level 10

Slight syntax problem. Try

[INSTALLDIR]blabla\[%COMPUTERNAME]
or
[INSTALLDIR]blabla\[ComputerName]


either should work equally well.
0 Kudos
rolf_wey
Level 3

DanGalender wrote:
Slight syntax problem. Try

[INSTALLDIR]blabla\[%COMPUTERNAME]
or
[INSTALLDIR]blabla\[ComputerName]


either should work equally well.


Thanks for reply, but: doesn't work :mad:



I think that InstallShield is not able to solve or to redirect the syntax at this place.

Any other suggestions?
0 Kudos
jaybee96
Level 8

1. Create custom Action ( 35)
Directory Name = PCNAME
Directory Value = [INSTALLDIR]blabla\[ComputerName]
place this in the sequence before InstallInitialize



2. Go to your ini file and change the target to [PCNAME]

works fine.

Jeroen
0 Kudos
rolf_wey
Level 3

jaybee96 wrote:
1. Create custom Action ( 35)
Directory Name = PCNAME
Directory Value = [INSTALLDIR]blabla\[ComputerName]
place this in the sequence before InstallInitialize



2. Go to your ini file and change the target to [PCNAME]

works fine.

Jeroen


Hi Jeroen,
works fine, thanks a lot 😄
0 Kudos