Check OS version for making of a tile

Post Reply
Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Check OS version for making of a tile

Post by Toolman » 07. Mar 2014, 15:11

Hello,

We are about to deploy Windows 8.1 tablets and are currently in the process of checking our packages.
In some cases we want to deploy a Metro Tile with the package, so there wil be a tile for the software in the Metromenu. We have got this working, but we do not want to create copies of our packages for Windows 7. How can I create an if statement that looks at the OS?

This is what we’ve got:

Code: Select all

[Product]
;#FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT
;ReplaceEnv <Variable>

#Set:Product
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:Product]
1:HARMONY_Client.rdp,                            ,               NORMAL,            1430

These 4 lines  should only be done on a Windows 8 machine
-----------------------------------------------------------------
1:Tiles\OblyTile.exe,                             C:\,            CLIENT MACHINE, 3804672
1:Tiles\Harmony\create_tile.cmd,          C:\,            CLIENT MACHINE,     286
1:Tiles\Harmony\Harmony.png,               C:\,            CLIENT MACHINE,    9156
CALL c:\Tiles\Harmony\create_tile.cmd
-----------------------------------------------------------------
Any help would be great!

Thanks,

Sander

Stefan
Posts: 127
Joined: 03. May 2013, 11:27
Contact:

Re: Check OS version for making of a tile

Post by Stefan » 07. Mar 2014, 15:46

Hi,

you can use for example an if statement and the OS.Name
I don´t know the exact name for Win 8.1 so the example is for Win 8

If %OS.Name% ="Windows 8" Then "Set:Win8Settings" EndIf

[Set:Win8Settings]
:Tiles\OblyTile.exe, C:\, CLIENT MACHINE, 3804672
1:Tiles\Harmony\create_tile.cmd, C:\, CLIENT MACHINE, 286
1:Tiles\Harmony\Harmony.png, C:\, CLIENT MACHINE, 9156
CALL c:\Tiles\Harmony\create_tile.cmd


Also its possible to make the if statement with os.version

regards,
Stefan

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Check OS version for making of a tile

Post by Toolman » 07. Mar 2014, 16:12

Hello Stefan,

Thanks for your reply. I now got this:

Code: Select all

[Product]
;#FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT
;ReplaceEnv <Variable>

#Set:Product
#Set:Win8Settings
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:Product]
1:HARMONY_Client.rdp,                 ,               NORMAL,            1430

If %OS.Name% ="Microsoft Windows 8.1 Enterprise" Then "Set:Win8Settings" EndIf

[Set:Win8Settings]
1:Tiles\OblyTile.exe,                        C:\,            CLIENT MACHINE, 3804672
1:Tiles\Harmony\create_tile.cmd,     C:\,            CLIENT MACHINE,     286
1:Tiles\Harmony\Harmony.png,         C:\,            CLIENT MACHINE,    9156
CALL c:\Tiles\Harmony\create_tile.cmd
And its working, but when I change the OS.Name to something different like "test" it still runs the Win8Settings.
What am I doing wrong?

Thanks,

Sander

Stefan
Posts: 127
Joined: 03. May 2013, 11:27
Contact:

Re: Check OS version for making of a tile

Post by Stefan » 07. Mar 2014, 16:15

you mustn´t activate it in the product section or the entry will be executed twice.
delete the entry
#Set:Win8Settings

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Check OS version for making of a tile

Post by Toolman » 07. Mar 2014, 16:24

I removed the entry, but now it doesn't run the extra commands :(

Stefan
Posts: 127
Joined: 03. May 2013, 11:27
Contact:

Re: Check OS version for making of a tile

Post by Stefan » 07. Mar 2014, 16:33

I think your statement ist wrong.
Windows 7 for example shows up as "Windows 7"
so if you use this statement, you have to look whats the exact name of the os.version variable in Windows 8.1

you can either start a step-by-step installation with the package editor and look which value the variable has or let the setup write a logfile with the variable data.

as an alternative you can try if "Windows 8*" in the statement is working. But then also all Windows 8 will get the files

regards,
Stefan

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Check OS version for making of a tile

Post by Toolman » 07. Mar 2014, 16:38

I did a systeminfo which gives me the OSname

Code: Select all


systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

OS Name:                   Microsoft Windows 8.1 Enterprise
OS Version:                6.3.9600 N/A Build 9600

But I think the OS.Name is a different one. I will look into it.

Thanks!

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Check OS version for making of a tile

Post by Toolman » 07. Mar 2014, 17:02

Turns out to be Windows 8 instead of Microsoft Windows 8.1 Enterprise

Thanks for your help!

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: No registered users and 3 guests