SetupBuilder Community  

Go Back   SetupBuilder Community > SetupBuilder Software Installation System > SetupBuilder 'How Do I' Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2012, 09:59 AM
elriba elriba is offline
Junior Member
 
Join Date: Apr 2005
Posts: 24
Default How to check if install is running on a Windows server (vs. workstation)?

Hi,

I need to add entries to the task scheduler, but I only want to do it if I'm installing on a server machine.

I already know how to add to the task scheduler. What I need to know is how to check if I'm running on one of the windows servers...

Thanks,
Edgard
Reply With Quote
  #2  
Old 04-02-2012, 10:12 AM
linder linder is offline
Administrator
 
Join Date: Mar 2004
Posts: 2,703
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Edgard,

What you can try is the "Get System Information (Windows Product Type)" script function. This lets you retrieve additional information about the Windows system. It can be one of the following values:

$VER_NT_WORKSTATION$—The system is running Windows Workstation.

$VER_NT_DOMAIN_CONTROLLER$—The system is a domain controller.

$VER_NT_SERVER$—The system is a server.

Does this help?

Friedrich
Reply With Quote
  #3  
Old 04-02-2012, 11:11 AM
elriba elriba is offline
Junior Member
 
Join Date: Apr 2005
Posts: 24
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Hi,

Thanks for the reply. It works fine in that the dialog only displays when running on a server.

However the problem is that the task is not added on the server :-) I re-read the documentation for "Add Scheduled Task" and surely enought it doesn't mention servers.....

Is it possible to add scheduled tasks to a server?


Thanks again,
Edgard
Reply With Quote
  #4  
Old 04-02-2012, 11:34 AM
linder linder is offline
Administrator
 
Join Date: Mar 2004
Posts: 2,703
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Edgard,

Yes, should work fine on Windows Server <g>

http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

Just tested it on Server 2008 R2 and it created the "My Taskname" without any problem.

HTH,
Friedrich
Attached Images
 
Reply With Quote
  #5  
Old 04-02-2012, 12:14 PM
elriba elriba is offline
Junior Member
 
Join Date: Apr 2005
Posts: 24
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Hi again,

Ok. It is working now partially.

I have a couple of requirements which might not be that easy to achieve....

1) I need to fill the "Location" field (which sets the working folder). The "Add Scheduled Task" function doesn't have an entry for this.

In my case this is important because the executable I want to run gathers information from other files on the startup folder (i.e. the folder where the executable is located at). If there is no startup folder, it looks for files on a windows folder.

2) The other problem I have is that I need to run the task at 10,12,2PM,4PM,6PM,8PM,9PM,10PM,11PM,12AM,1AM. Can this be done?

I tried adding the task repeatedly, each time with the next hour, but after the first task is added, all the next fail.

Sorry for all the trouble,
Edgard
Reply With Quote
  #6  
Old 04-03-2012, 02:42 AM
linder linder is offline
Administrator
 
Join Date: Mar 2004
Posts: 2,703
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Edgard,

1) In the upcoming V7.7, you can set the "Working Directory" (see attached screenshot).

I don't have a good answer to 2). In V7.7 there is a "Repeat Task (Minutes)" option but as I understand it, your "repeat task" is not constant.

BTW, the task name has to be unique! If you add the task repeatedly and it fails then you tried to add the same task (name) twice. Windows does not allow this.

HTH,
Friedrich
Attached Images
 
Reply With Quote
  #7  
Old 04-03-2012, 08:12 AM
elriba elriba is offline
Junior Member
 
Join Date: Apr 2005
Posts: 24
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Quote:
Originally Posted by linder View Post
1) In the upcoming V7.7, you can set the "Working Directory" (see attached screenshot).
That is great! Hopefully V7.7 will come out soon


Quote:
Originally Posted by linder View Post
I don't have a good answer to 2). In V7.7 there is a "Repeat Task (Minutes)" option but as I understand it, your "repeat task" is not constant.
Yes, I need to repeat in a non-constant manner. Manually you can set it up (see attachment), but it is not as essential. Maybe in a future version you can add this.

Thanks!
Edgard
Attached Images
 
Reply With Quote
  #8  
Old 04-04-2012, 07:44 AM
linder linder is offline
Administrator
 
Join Date: Mar 2004
Posts: 2,703
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Quote:
Originally Posted by elriba View Post
That is great! Hopefully V7.7 will come out soon
It's available now

Friedrich
Reply With Quote
  #9  
Old 04-04-2012, 03:48 PM
elriba elriba is offline
Junior Member
 
Join Date: Apr 2005
Posts: 24
Default Re: How to check if install is running on a Windows server (vs. workstation)?

Hi Friedrich,

Great news! I already downloaded it, and tested it. I added my task to the Task Scheduler, and compromised by setting the "Repeat Task" to 90 minutes, and the proper startup folder.

When the task is added, the setting "For a duration of" gets a 1 day only setting. I went ahead and changed it manually to "Indefinitely".

I guess this is something you might want to look at...

Thanks,
Edgard
Attached Images
 
Reply With Quote
Reply

Tags
server, task scheduler


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004-2012 Lindersoft