Monday, 15 July 2013

c# - Visual Studio setup project: run CustomActions/process as current user not system account -



c# - Visual Studio setup project: run CustomActions/process as current user not system account -

i'm using setup project in visual studio 2010 c# outlook add-in (office 2010/2013) , other standalone tool. during installation kill instances of outlook, afterwards want restart instance of outlook.

in addin project added installerclass , added installeventhandler(afterinstalleventhandler) execute

process.start("outlook");

while same command opens outlook in other compiled class, in context of installer outlook opens in profile creation assistant.

i tried run said working compiled exe user defined action after commit, same problem occurs.

any solution or explanation appreciated.

solution:

the installation runs in scheme account. therefor created process run in said business relationship not logged in user.

i created additional project (installhelper), includes the

process.start("outlook");

i added installhelper customaction on commit in setup project , changed installerclass false in properties of customaction. copied wirunsql.vbs project folder , added postbuildevent setup project:

@echo off cscript //nologo "$(projectdir)wirunsql.vbs" "$(builtouputpath)" "update customaction set type=1554 type=3602"

3602:

0x800 (msidbcustomactiontypenoimpersonate) 0x400 (msidbcustomactiontypeinscript) 0x200 (msidbcustomactiontypecommit) 0x12 (custom action type 18: exe)

1554:

0x400 (msidbcustomactiontypeinscript) 0x200 (msidbcustomactiontypecommit) 0x12 (custom action type 18: exe)

see: msdn: custom action in-script execution options

the type alter removed bit msidbcustomactiontypenoimpersonate (0x00000800), installhelper created process run logged in user, not system.

alternatively changes possible via opening msi in orca (has repeated after each build, prefer scripted change).

c# visual-studio-2010 setup-project outlook-2013

No comments:

Post a Comment