Edit a file based on detected windows version (win 8, 7 ) - Advanced Installer Community
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Edit a file based on detected windows version (win 8, 7 )

Hi,
I have requirement to edit a file based on the detected windows version of target system .
for example i have a batch file "example.bat" . once user installs the exe the installer should detect the windows version for example windows 8 or 7 and edit a line in the batch file .

Thanks for support .
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Edit a file based on detected windows version (win 8, 7 )

Hello,

For this you can use the VersionNT property. The installer sets the VersionNT property with the following values:
  • 501 for Windows XP
  • 502 for Windows Server 2003
  • 600 for Windows Vista and Windows Server 2008
  • 601 for Windows 7 and Windows Server 2008 R2
  • 602 for Windows 8 and Windows Server 2012
  • 603 for Windows 8.1 and Windows Server 2012 R2
  • 1000 for Windows 10 and Windows Server 2016
To pass parameters to the .bat file, please follow the steps from the How to launch a CMD or BAT file? article.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Edit a file based on detected windows version (win 8, 7 )

Hi Den,
Thanks for the reply, it is very helpful
Please note that I want to "EDIT" not launch the batch file based on the windows version .
Please help me with this .
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Edit a file based on detected windows version (win 8, 7 )

Hello,

For this you can try to use our "Text File Updates" feature. For instance you can add one text file update for each of your target OS and, then condition their associated component in "Organization" page using the "VersionNT" or "VersionNT64" properties.

If your text file updates target the same file name, then an approach will be to create under the parent folder a sub-folder for each update operation and enable its "Install folder content into the parent folder" option.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”