Setup Project, Custom Actions Editor

Hi,

I try to use Regedit.exe in custom action.

I add it from "Windows folder" (after I add it from the Special folders) but

at the property sourcePath of this custom action I get the absolute path (C:\Windows\regedit.exe) instead of the relative path.

If I try to install on windows 2000 the installation failed because the path is incorrect.

(c:\WINNT\Regedit.exe).

Any suggestions...  (I Don't want to call regedit.exe from installer class after I get the relative path. it's cause me other problems).

Thanks, Eitan

 



Answer this question

Setup Project, Custom Actions Editor

  • Darren Baldwin

    Why not have your application check the Registry on startup, and then add the default entries if they are not there. It will simplify your installation, give you the possibility of moving to ClickOnce, and make your app more bullet-proof in case someone else removes the reg keys.

     



  • Mike Lavender

    Hi again,

    At the past I tried to use vbsript but it cause another problem:

    when I used :

       dim obj
       set obj = WScript.CreateObject("WScript.Shell")

    I get the error message: "There is a problem with the Windows Installer Package. A script required for this install to complete could not be run. Contact your support personal or package vendor."

    The reason I don't want to use the Registry Editor is that after the installation I cannot changed the registry values. The next time I run my application the installation is running again and restored the default values.

    I just found another solution: I will use registry editor and after I will build the Setup project, I will edit the msi file with another tool named Orca.exe:

    1. In Orca program open *.msi setup file

    2. Go to "Property table"

    3. Add column named "DISABLEADVTSHORTCUTS" with value "1"

                        4. Save changes by Orca program

    I think that the Setup Project should support:

    1. property to disable this check.

    2. using of the WScript.Shell Object

    3. A way to use the regedit.exe without the warnings.

    another thing, I also used installer class to run the regedit but I got exception during the installation.

    I'm developing  with the VS  2005 (framework v2.0.50727) when I try to install on machine with V2.0.50215 framework it's work fine but when I try to install on machine same like I using I get exception: System.BadImageFormatException "...the format of the file myinstallerclass.dll is invalid"

     

    Thanks a lot Eitan.



     


  • Leho

    Eitan, the source path refers to where it is on the development machine.  This should work fine if you add the windows folder, in the file system editor, then add regedit to it.  Double check that you do not have it marked as an installer class or that you have incorrect parameters being sent to it.

    I hope that helps.



  • dimondlight

    Hi Todd,

    I did exactly as you wrote me except that I set the Exclude property to true.

    Now, It's working but I get warning that the file should be exclude because it's under windows system file protection. And... during the installation I get another warning:

    "Window installer service cannot update the system file "C:\winnet\Regedit.exe" because the file is protected by windows.

    So, if the Exclude is set to true I doesn't work for me and if it's set to false I get the warnings.

    Any Idea

    Thanks, Eitan

     


  • JoelB2

    Hi,
    I don't want my application will check for registry changes. I just need to install the default values in the registry. Another things that if my users will add some more keys to the registry (while using my application) when they uninstall the application the keys that are not "Default Keys" will not removed from the registry only those who set by the setup project (I want this behavior of the setup project).
    One last thing, as far as I know I cannot use the ClickOnce cause my application is written in Delphi and some pulgins in C# (some class libraries). (I do need the update option of the ClickOnce).
    Eitan Shapir.


  • SnakeLair

    Setup projects contain the logic to determine if a file is under windows file protection, they also contain the logic to realize that if a file is excluded it cannot run, it however doesn't include the logic to determine if a file already exists on another system.  (BTW: being under windows file protection does not guarantee that it exists on all systems).  The right way to call an existing file would be in the form of a scripted custom action, %windir%\regedit.exe would do it.  However if you are doing something in the registry I would suggest using the registry editor included with the setup project.

  • Setup Project, Custom Actions Editor