locked
Custom Action will not run & Error 1721 RRS feed

  • Question

  • As the last step in a Major revions of an application, I moved the solution from VS2008 to VS2010. I also moved all projects from .Net 2 & 3.5 to .Net 4 (client) . This all seemed to work fine.

    However, the Setup Project is giving me fits. I did not have to make any changes ( except Version Numbers) to the setup project. I previously created a C# exectuable for a custom action and included it in my setup (MSI). The custom action in the commit step that was working is not working now.  I try to execute it and it fails.

    A couple of observations: This only seems to happen if/when I am installing on a machine with a previous version installed. If I look at the TARGETDIR when the error happens, I noticed that most of the files from the MSI have not been installed yet there are enough ".tmp" files to account for all of the files.

    Here is the code:

        class Program
        {
            static int Main(string[] args)
            {
                //and if this is Vista (or Server 2008?)
    
                foreach (string dir in args)
                {
                    if ((Directory.Exists(dir) == true) &&
                        (Environment.OSVersion.Version.Major >= 6))
                    {
    
                            //Give Users full access to the dir folders
    
                            string arguments =
    
                                "\"" + dir.TrimEnd(new char[] { '\\' }) + "\" " +
    
                                "/G Users:F /T /E";
    
                            Process caclsProcess = Process.Start(
    
                                    "CACLS",
    
                                    arguments);
    
                            caclsProcess.WaitForExit();
    
                    }
                }
    
                return 0;
            }
    

    Here is the error (from the log):

    MSI (s) (34:18) [08:54:40:433]: Note: 1: 1721 2: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1 3: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe 4: "C:\Documents and Settings\All Users\Application Data\\DIR2\APPDIR"
    DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
    The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
    Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1, location: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe, command: "C:\Documents and Settings\All Users\Application Data\\DIR2\APPDIR"
    MSI (s) (34:18) [08:54:45:105]: Product: INSTALLERNAME -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1, location: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe, command: "C:\Documents and Settings\All Users\Application Data\\DIR1\APPDIR"

    Can someone tell me what is going on? Or at least point me in the right direction?

    Thanks!

    Wednesday, May 9, 2012 4:03 PM

Answers

  • Your program is apparently crashing, so this comes dowen to writing that code to detect errors. Process.Start could be throwing an exception, just as an example.

    The bigger issue may be that you can't see that network drive. Custom actions on UAC machines run with the system account during an Everyone install, and that account doesn't have access to mapped drives (they are user profile things, not system wide).


    Phil Wilson

    Wednesday, May 9, 2012 5:15 PM
  • My shortcut problem is due to an unreleted change and involves the DISABLEADVTSHORTCUTS.

    So this problem was fixed by simply setting BackwardCompatibleIDGeneration to true.

    • Marked as answer by BuddyAtHome Thursday, May 10, 2012 6:34 PM
    • Proposed as answer by Jason Dot Wang Friday, May 11, 2012 3:16 AM
    • Marked as answer by Jason Dot Wang Wednesday, May 16, 2012 3:43 AM
    Thursday, May 10, 2012 6:34 PM

All replies

  • As the last step in a Major revions of an application, I moved the solution from VS2008 to VS2010. I also moved all projects from .Net 2 & 3.5 to .Net 4 (client) . This all seemed to work fine.

    However, the Setup Project is giving me fits. I did not have to make any changes ( except Version Numbers) to the setup project. I previously created a C# exectuable for a custom action and included it in my setup (MSI). The custom action in the commit step that was working is not working now.  I try to execute it and it fails.

    A couple of observations: This only seems to happen if/when I am installing on a machine with a previous version installed. If I look at the TARGETDIR when the error happens, I noticed that most of the files from the MSI have not been installed yet there are enough ".tmp" files to account for all of the files.

    Here is the code:

        class Program
        {
            static int Main(string[] args)
            {
                //and if this is Vista (or Server 2008?)
    
                foreach (string dir in args)
                {
                    if ((Directory.Exists(dir) == true) &&
                        (Environment.OSVersion.Version.Major >= 6))
                    {
    
                            //Give Users full access to the dir folders
    
                            string arguments =
    
                                "\"" + dir.TrimEnd(new char[] { '\\' }) + "\" " +
    
                                "/G Users:F /T /E";
    
                            Process caclsProcess = Process.Start(
    
                                    "CACLS",
    
                                    arguments);
    
                            caclsProcess.WaitForExit();
    
                    }
                }
    
                return 0;
            }
    

    Here is the error (from the log):

    MSI (s) (34:18) [08:54:40:433]: Note: 1: 1721 2: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1 3: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe 4: "C:\Documents and Settings\All Users\Application Data\\DIR2\APPDIR"
    DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
    The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
    Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1, location: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe, command: "C:\Documents and Settings\All Users\Application Data\\DIR2\APPDIR"
    MSI (s) (34:18) [08:54:45:105]: Product: INSTALLERNAME -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: _DA28B998_20A9_475A_BA65_A6AF0ADFFAE1, location: C:\Program Files\DIR1\APPDIR\PermissionChanger.exe, command: "C:\Documents and Settings\All Users\Application Data\\DIR1\APPDIR"

    Can someone tell me what is going on? Or at least point me in the right direction?

    Thanks!

    Wednesday, May 9, 2012 4:04 PM
  • Your program is apparently crashing, so this comes dowen to writing that code to detect errors. Process.Start could be throwing an exception, just as an example.

    The bigger issue may be that you can't see that network drive. Custom actions on UAC machines run with the system account during an Everyone install, and that account doesn't have access to mapped drives (they are user profile things, not system wide).


    Phil Wilson

    Wednesday, May 9, 2012 5:15 PM
  • I actually tried adding a try catch block around the entire foreach block. In the catch, I did a MessageBox but did not see anything. I am not using any mapped drivers that I am aware of.

    Wednesday, May 9, 2012 5:37 PM
  • For kicks, I added this before the foreach loop.

    MessageBox.Show("Buddy was here", "buddy was here", MessageBoxButtons.OK, MessageBoxIcon.Exclamation,MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);

    I do not see the message when I run the installer.

    Wednesday, May 9, 2012 5:55 PM
  • The mystery is coming more into focus ...

    If I run the installer on a system without a previous version everything installs fine.

    I took out the custom action to see what the installer did since the custom action is more about a runtime secuirty issue than anythingelse.  If I run the installer on system with a previous version, NONE of the DLLs & exes that come from my projects are installed ( i.e. those files are missing).

    I was looking at the Deployment Project Properties and noticed one called "BackwardCompatibleIDGeneration". I had never noticed it before.  CHanging it from false to true fixes the problem. The DLLS & EXEs are installed and the custom action runs like it is supposed to... but now the desktop and menu shortcuts are not installing.

    So I am getting closer to a ful solution.

    Wednesday, May 9, 2012 7:18 PM
  • My shortcut problem is due to an unreleted change and involves the DISABLEADVTSHORTCUTS.

    So this problem was fixed by simply setting BackwardCompatibleIDGeneration to true.

    • Marked as answer by BuddyAtHome Thursday, May 10, 2012 6:34 PM
    • Proposed as answer by Jason Dot Wang Friday, May 11, 2012 3:16 AM
    • Marked as answer by Jason Dot Wang Wednesday, May 16, 2012 3:43 AM
    Thursday, May 10, 2012 6:34 PM