Archive: ExecWait 'gacutil.exe'


ExecWait 'gacutil.exe'
I have being trying to use the 'ExecWait' with GacUtil.exe.
For some reason it will not work. It will work through a .bat file and on the command prompt. Also, note that I am executing regasm.exe on a different .dll and that works fine. I am including a copy of both regasm.exe and gacutil.exe with the installer.
I am using the code below.

CreateDirectory $INSTDIR\Bin
File /oname=$INSTDIR\Bin\Custom.Library.dll Custom.Library.dll
StrCpy $0 $OUTDIR
StrCpy $OUTDIR "$INSTDIR\Bin" ;The directory of the .dll.
MessageBox MB_OK $OUTDIR
ExecWait 'gacutil /u "Custom.Library"' $1
MessageBox MB_OK $1

As you can see I change the working directory, so that the parameters passed are as simple as possible. This comes from trying to solve this problem. I am using the MessBox for debuging purpose only. It normaly returns an exit code of 1.


Copying something into $OUTDIR doesn't change the working directory. You must use SetOutPath for that. Using SetOutPath will also save you using /oname.


Thank you for the info. since I posted I have figured it out.
It always seems to work like that. You think you have done all you can, then you ask for help and figure it out before you go back to check on the help.

At any rate this is what I did using ExecDos plugin:

install:
StrCpy $0 "$\"$INSTDIR\Bin\gacutil.exe$\" /nologo /i $\"$INSTDIR\Bin\Custom.Library.dll$\""
ExecDos::exec /DETAILED "$0" "" ""
StrCpy $0 "$\"$INSTDIR\Bin\RegAsm.exe$\" /nologo /codebase /tlb:$\"$INSTDIR\Extensions\MyExten.tlb$\" $\"$INSTDIR\Extension\MyExten.dll$\""
ExecDos::exec /DETAILED "$0" "" ""

uninstall: (Remove items from GAC last)
Push $0
StrCpy $0 "$\"$INSTDIR\Bin\RegAsm.exe$\" /nologo /unregister $\"$INSTDIR\Extensions\MyExten.dll$\""
ExecDos::exec /DETAILED "$0" "" ""
StrCpy $0 "$\"$INSTDIR\Bin\gacutil.exe$\" /nologo /u Custom.Library"
ExecDos::exec /DETAILED "$0" "" ""