Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Running batch files on Windows XP


9 replies to this topic

joglekar

joglekar
  • Members
  • 5 posts

Posted 30 July 2004 - 23:23

We have an install written in Developer 7 of Installshield using standard project. (i.e. Using install script). As part of installation certain tasks are performed using a batch file. Install used to perform fine under Windows 2000. Recently we tried this on Windows XP and found out that running batch files was proving to be a no-op. In particular, same batch file can be successfully executed during the UI sequence but if it is called during 'execute' sequence it does not work. More specifically, if it is called in the handler defaultfeature_installed it does not work. Similarly during Uninstall it cannot be run in DefaultFeature_Uninstalled or DefaultFeature_Uninstalling. Can someone answeer why it behaves this way on Xp and not on Windows 2000?

Thanks.

Edited by joglekar, 30 July 2004 - 23:25.


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 31 July 2004 - 02:23

Is terminal services enabled on the XP box?
Regards
-Stein Åsmul

joglekar

joglekar
  • Members
  • 5 posts

Posted 02 August 2004 - 19:38

Terminal services are running on the computer and start up type is manual.



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 03 August 2004 - 03:33

I believe all custom actions are run in system context in the execute sequence on systems with terminal server enabled. It should still work provided you don't reference mapped drives, HKCU or similar. I am not sure if cmd.exe is available in system context. What is the nature of your batch files, what are they doing?

Joglekar, kult namn.
Regards
-Stein Åsmul

joglekar

joglekar
  • Members
  • 5 posts

Posted 03 August 2004 - 17:40

Well we are creating a web site on a specific port with virtual directories etc. It is done through windows scripting and called through a batch file for creating and deleting the web site but that is really not the issue because I created a simple one line batch file

echo abc

and this was still a no-op. User invoking install belongs to administrators on the XP machine though the machine is on a network and the user is logged in the domain where he does not have administrative privilege

By the way this is NOT coded explicitly as a custom action but called through installscript event handlers DefaultFeature_installed, DefaultFeature_uninstalled and DefaultFeature_uninstalling.

Thanks for looking into this.

AnnDunbar

AnnDunbar
  • Members
  • 3 posts

Posted 06 August 2004 - 21:12

I had a similar problem when my current working directory was set to a UNC path. When I changed to mapped drive as the CWD, my batch file started working.

joglekar

joglekar
  • Members
  • 5 posts

Posted 06 August 2004 - 23:20


Thanks for your response.

I built this on an XP box and could not install it on the same box. No UNC paths are involved. Also the batch files work in the UI sequence.

joglekar

joglekar
  • Members
  • 5 posts

Posted 09 August 2004 - 19:33


I disabled Terminal service rebooted and tried to install. Disabling terminal service made no difference.

Is inability to run external programs during execute sequence (at least in Insrtallshield's 'standard project' ) well known?
Is this a bug? Is this known and expected behavior on Windows XP platform?

Thanks.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 10 August 2004 - 12:31

Have you tried this setup on a different computer? I don't think you can eliminate the system changes made by the terminal services setp as
easily as that.
Regards
-Stein Åsmul

Usman Javaid

Usman Javaid
  • Members
  • 15 posts

Posted 17 April 2006 - 11:17

You may try a simple tip. If you are using LaunchApp function then try these values in parameters:

LaunchAppAndWait ("cmd.exe", "/c cmd /c rstemp",WAIT|LAAW_OPTION_HIDDEN)

First change your directory to the location of file (rstemp.bat).
DONT use the .bat extension.