Forum Discussion

mpstrong's avatar
mpstrong
New Contributor
13 years ago

Running ClickOnce app

I need to test an application that is distributed as a ClickOnce application.  There is a utility script on this web site that I have copied and tried to use in my script.



Sub RunClickOnceApplication()



  Dim path 

  path = "C:\U2\SBXA\PresentationComponents\RichClient\SBXAWinFXWindow.application" ' e.g. "c:\Sample ClickOnce\sample.appref-ms" 

  Set WshShell = CreateObject("WScript.Shell") 

  WshShell.Run("rundll32.exe dfshim.dll,ShOpenVerbShortcut " & path)



End Sub



The only thing I have changed is to plug in the application path.  When I run this subroutine, I get an error and the application does not open.  If I double click on this file in Windows Explorer or run the file from the Start->All Programs->Accessories->Run window, it works fine. Any ideas why this won't work from within TestComplete 8.0?



Mike

  • Hi,



    You should use the *.appref-ms file, not *.application to run your application with the ShOpenVerbShortcut function. Alternatively, try launching the *.application file without a rundll32 call. Normally, Run should be able to start anything you can run from the shell.



    Also, note that this is not related to TC at all. WScript.Shell, rundll32 and dfshim.dll are components provide by Microsoft.