/// <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; Simply._SA_StartProgram(true); //Simply._SA_StartProgram(false, false, "C:\\Users\\wonga01\\Documents\\Simply Accounting\\DATA\\test company 3.sai"); }
public static void InstallSage50(string sBuildPath, REGI_DATA regdata, bool bOpenSampleDb, bool bServerInstall) { bool bInstallSuccess = false; bool bRegister = true; string sInstalledPath = ""; bool bNeedCleanup; string sCompanyName = regdata.Company; string sSerial1 = regdata.SerialNum1; string sSerial2 = regdata.SerialNum2; string sClientID = regdata.ClientID;; string sKeyCode1 = sSerial1; string sKeyCode2 = ""; string sKeyCode3 = ""; string sKeyCode4 = ""; string sKeyCode5 = ""; if (GoodData(regdata.ClientID) && GoodData(regdata.Keycode2) && GoodData(regdata.Keycode3) && GoodData(regdata.Keycode4) && GoodData(regdata.Keycode5)) { sKeyCode2 = regdata.Keycode2; sKeyCode3 = regdata.Keycode3; sKeyCode4 = regdata.Keycode4; sKeyCode5 = regdata.Keycode5; } else { bRegister = false; } if (!GoodData(bOpenSampleDb)) { bOpenSampleDb = true; } // Close Sage 50 if necessary if (Simply.repo.SelfInfo.Exists()) { Simply._SA_CloseProgram(); // Make sure db is released from CM service System.Threading.Thread.Sleep(37000); } sInstalledPath = Simply._SA_GetProgramPath(); bNeedCleanup = CleanupNeeded(sInstalledPath); bool bCleanCompleted; if (bNeedCleanup) { bCleanCompleted = SimplyUninstall._SA_Uninstall(); } else { bCleanCompleted = true; } // Install Sage 50 bInstallSuccess = SimplyInstall._SA_Install(sBuildPath, sSerial1, sSerial2, bServerInstall); if (!bServerInstall && bRegister) { // Start sage 50 Simply._SA_StartSage50(); // Register Register._SA_Register(sCompanyName, sSerial1, sSerial2, sClientID, sKeyCode1, sKeyCode2, sKeyCode3, sKeyCode4, sKeyCode5); // Wait for Select company dialog to appear while (!SelectCompany.repo.SelfInfo.Exists()) { System.Threading.Thread.Sleep(1000); } // Open sample company or stop at Select company dialog if (bOpenSampleDb) { Simply._SA_StartProgram(true); } } }