Two suggestions:

1) Pass the path to the batch file on the batch file invocation command line 
and then CD to that path in the script.

   <CustomAction Id='LaunchMyBat' Directory='INSTALLDIR'
     ExeCommand='"[INSTALLDIR]My.bat" "[INSTALLDIR]"' Return='asyncNoWait' />

And then in your my.bat file:
   Rem Gets the path of my .bat file from the command line
   Set MYPATH=%1%

   Rem CD to my path
   Cd /D %MYPATH%

   Rem Run the driver installer
   Setupdrv.exe installs

2) Change your batch file a little to get its own location and CD there.

   <CustomAction Id='LaunchMyBat' Directory='INSTALLDIR'
    ExeCommand='[INSTALLDIR]My.bat' Return='asyncNoWait' />

And then in my.bat:
   Rem Get the path of my.bat file. 
   Rem %0 is the path to the batch file
   Set MYPATH=%~dp0%

   Rem CD to my path
   Cd /D %MYPATH%

   Rem Run the driver installer
   Setupdrv.exe installs
 
Personally, I like #2 better.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Matador2k7
> Sent: Tuesday, January 23, 2007 9:30 AM
> To: wix-users@lists.sourceforge.net
> Subject: Re: [WiX-users] Running a file after installation
> 
> 
> Hi Patrick!
> 
> First of all, thank you very much for your post, but it 
> didn´t work so, now,
> I will detail my case a little bit more:
> 
> The installer creates in the ProgramFilesFolder a folder 
> called UltraVNC.
> And, in the folder UltraVNC a new folder is created called 
> driver. So the
> structure should be: %PROGRAMFILES%\UltraVNC\driver
> 
> In the driver dir, I have an .inf file and some dll's that should be
> installed. For this, I must use this command line: 
> "setupdrv.exe installs"
> or simply a .bat file with this command line.
> It is necessary that it is launched from this dir, because if not, the
> driver will not be installed so I don't mind hard-coding it...
> 
> If I use this one: Directory="INSTALLDIR" which dir is taken? 
> The driver dir
> or the UltraVNC dir?
> 
> Thanks!
> 
> 
> Patrick Steele-2 wrote:
> > 
> > Try somethinbg like this:
> > 
> > <CustomAction Id='LaunchMyBat' Directory='INSTALLDIR'
> > ExeCommand='[INSTALLDIR]My.bat' Return='asyncNoWait' />
> > 
> > <InstallExecuteSequence>
> > <Custom Action='LaunchMyBat' After='InstallFinalize'>NOT
> > Installed</Custom>
> > </InstallExecuteSequence>
> > 
> > This way you are also not hard coding the directory 
> location of the batch
> > file and you are only running it during the install, not 
> the uninstall,
> > after all files have been added.
> > 
> > Patrick
> > 
> > 
> > 
> > 
> > 
> > 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf 
> Of Matador2k7
> > Sent: 23 January 2007 11:35
> > To: wix-users@lists.sourceforge.net
> > Subject: [WiX-users] Running a file after installation
> > 
> > 
> > Hello.
> > I'm making an MSI installer for Ultra VNC in my company. Now I got a
> > little
> > problem:
> > 
> > I copy some files into this folder: C:\ARCHIVOS DE
> > PROGRAMA\ULTRAVNC\DRIVER
> > 
> > In this folder exists a file called install_silent.bat
> > 
> > Now, I'd liked to run this file AFTER installation, in 
> order to get the
> > driver installed. I'm doing it right this at the moment:
> > 
> > <Property Id="DRIVER" Value="C:\Archivos de 
> programa\UltraVNC\driver" />
> >     <CustomAction Id="LaunchFile" 
> ExeCommand="[DRIVER]install_silent.bat"
> > Return='asyncNoWait'/>
> > 
> > The problem is that the driver isn´t installed. Am I using the right
> > syntax for this job?
> > 
> > Thanksss!
> > --
> > View this message in context:
> > 
> http://www.nabble.com/Running-a-file-after-installation-tf3063
> 560.html#a8519908
> > Sent from the wix-users mailing list archive at Nabble.com.
> > 
> > 
> > 
> --------------------------------------------------------------
> -----------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the 
> chance to share
> > your
> > opinions on IT & business topics through brief surveys - 
> and earn cash
> > 
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> > 
> > 
> --------------------------------------------------------------
> -----------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the 
> chance to share
> > your
> > opinions on IT & business topics through brief surveys - 
> and earn cash
> > 
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Running-a-file-after-installation-tf3063
> 560.html#a8522632
> Sent from the wix-users mailing list archive at Nabble.com.
> 
> 
> --------------------------------------------------------------
> -----------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the 
> chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to