Running Setups

Ranorex Studio, Spy, Recorder, and Driver.
yoad
Posts: 39
Joined: Sun May 26, 2013 9:08 am

Running Setups

Post by yoad » Thu Aug 01, 2013 4:17 pm

Hello,
I tried to create running Setups in file "UserCodeModule1.cs"
But it is not working
I got error message
Unrecognized escape sequence (CS1009) - C:\Users\Yoad\Documents\Ranorex\RanorexStudio Projects\Easyadmin-Functional_Tests\Easyadmin-Functional_Tests\UserCodeModule1.cs:52,111
Unrecognized escape sequence (CS1009) - C:\Users\Yoad\Documents\Ranorex\RanorexStudio Projects\Easyadmin-Functional_Tests\Easyadmin-Functional_Tests\UserCodeModule1.cs:52,92
Unrecognized escape sequence (CS1009) - C:\Users\Yoad\Documents\Ranorex\RanorexStudio Projects\Easyadmin-Functional_Tests\Easyadmin-Functional_Tests\UserCodeModule1.cs:52,84
Unrecognized escape sequence (CS1009) - C:\Users\Yoad\Documents\Ranorex\RanorexStudio Projects\Easyadmin-Functional_Tests\Easyadmin-Functional_Tests\UserCodeModule1.cs:52,79
Unrecognized escape sequence (CS1009) - C:\Users\Yoad\Documents\Ranorex\RanorexStudio Projects\Easyadmin-Functional_Tests\Easyadmin-Functional_Tests\UserCodeModule1.cs:52,72

Code: Select all


/*
 * Created by Ranorex
 * User: Yoad
 * Date: 01/08/2013
 * Time: 17:59
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Threading;
using WinForms = System.Windows.Forms;

using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;

namespace Easyadmin_Functional_Tests
{
    /// <summary>
    /// Description of UserCodeModule1.
    /// </summary>
    [TestModule("CAAF58B6-42C3-4A42-837A-83E5A5D3BA01", ModuleType.UserCode, 1)]
    public class UserCodeModule1 : ITestModule
    {
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        public UserCodeModule1()
        {
            // Do not delete - a parameterless constructor is required!
        }

        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;
            ProcessStartInfo procInfo = new ProcessStartInfo();
            procInfo.WindowStyle = ProcessWindowStyle.Hidden;
            procInfo.UseShellExecute = true;
            procInfo.FileName = My.Application.Info.DirectoryPath + "C:\Users\Yoad\Desktop\setups and configs\1.8\openlm_server_win_1.8.\d.msi";
            procInfo.WorkingDirectory = "";


if ((My.Computer.Info.OSFullName.ToString.Contains("Vista") == true) | (My.Computer.Info.OSFullName.ToString.Contains("Windows 7") == true)) {
	procInfo.Verb = "runas";

}

Process.Start(procInfo);
        }
    }
}

regards,
Yoad

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Running Setups

Post by Ciege » Thu Aug 01, 2013 5:23 pm

This is the line that is causing your problems...

Code: Select all

procInfo.FileName = My.Application.Info.DirectoryPath + "C:\Users\Yoad\Desktop\setups and configs\1.8\openlm_server_win_1.8.\d.msi";
            procInfo.WorkingDirectory = "";
The compiler is interpreting the "\s as escapes. You either need to double up on the \s or add an @ before the first quote.

Code: Select all

procInfo.FileName = My.Application.Info.DirectoryPath + @"C:\Users\Yoad\Desktop\setups and configs\1.8\openlm_server_win_1.8.\d.msi";
            procInfo.WorkingDirectory = "";
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

yoad
Posts: 39
Joined: Sun May 26, 2013 9:08 am

Re: Running Setups

Post by yoad » Sun Aug 04, 2013 8:25 am

thank you!
it are working without My.Application.Info.DirectoryPath and My.Computer.Info.OSFullName