registering an addin

registering an addin

Anonymous
Not applicable
533 Views
9 Replies
Message 1 of 10

registering an addin

Anonymous
Not applicable
Does anyone have a sample or tutorial on how to get an add-in to register automatically when running the MSI?
The .bat file works but it would be nice for the users to not have to complete the setup.
0 Likes
534 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
What language is the Add-In written in? If it's VB.Net then it also depends
on which version of VB.Net you're using. If is VB Express then there isn't
anything provided with it to create an installation. That's the reason for
the .bat solution. For the other versions you can create installer
projects. I don't have a sample or instructions on using this but it's
something we should put together. There's also the possibility in either
case of using a third party installer.
--
Brian Ekins
Autodesk Inventor API.
0 Likes
Message 3 of 10

Anonymous
Not applicable
Sorry, I guess your mind reading abilities don't reach this far. I'm using VB.net.(vs2005)
0 Likes
Message 4 of 10

Anonymous
Not applicable
Nobody has anything?
0 Likes
Message 5 of 10

Anonymous
Not applicable
Sorry, I hoped I had still answered your question in the previous email. As
a result of your question we have done a bit more research since then to
look at how to create a viable installer using Visual Studio. We're still
researching and doing some experimenting. We have something that is working
but am not sure it's the best solution. We still need to write up the
procedure too. Hopefully I can post the steps later this week. In the
meantime there's always the .bat approach and is still probably the best
approach for VB Express.
--
Brian Ekins
Autodesk Inventor API
0 Likes
Message 6 of 10

fourholesn1
Enthusiast
Enthusiast
Was an installer ever created?
0 Likes
Message 7 of 10

Rene-J
Collaborator
Collaborator
I am Using VS 2005

Install ny Inventer Addin

I am using Nullsoft Installer

http://nsis.sourceforge.net/Main_Page



see Attach file



René J


Edited by: Rene-J on Oct 31, 2008 5:23 PM Edited by: Rene-J on Oct 31, 2008 5:24 PM
0 Likes
Message 8 of 10

fourholesn1
Enthusiast
Enthusiast
Is that a free program? I don't see a price on their web site. Do you have anything I can have to use as an example of how to use it? Thanks Rene.
0 Likes
Message 9 of 10

Rene-J
Collaborator
Collaborator
Yes Nullsoft installer is free
I have a exsample I got a error
when I trying to attach a txt file with this message
René J
0 Likes
Message 10 of 10

Rene-J
Collaborator
Collaborator

The code in the Nsi file:


;NSIS Version 2.0 Script using Modern Interface
Name "MyInventorAdd-in"
!define PRODUCT "My Inventor Add-in"
!define ADDIN_NAME "MYInventorAdd-in" ;Name that shows up in the Inventor Addin Manager
!define ADDIN_DLL "bin\MYInventorAdd-in.dll" ;The Addin Dll In my program
;!define File1 "bin\LineControls.dll" ;Exstra files I need, With my program

!define ADDIN_DLL1 "MYInventorAdd-in.dll" ;The Addin Dll
;!define File_1 "LineControls.dll" ;

!define DESCRIPTION "My Inventor Add-in" ;Description that shows up in the Inventor Addin Manager
!define UNINST_EXE "UninstMyInventorAdd-in.exe" ;Name of the uninstall program
!define INST_FILE "InstMyInventorAdd-in.exe" ;The install program name

!define INST_DEF_DIR "C:\Program Files\Autodesk\Macros\MyInventorAdd-in" ;C:\Program Files\ will be prepended

!include WordFunc.nsh
!insertmacro WordReplace


OutFile "${INST_FILE}"

;------------------------------------------------------


;---Check for regasm
Section "Checkregasm" checkregasm


IfFileExists $WINDIR\Microsoft.NET\Framework\v2.0.50727\regasm.exe Found NoFound

NoFound:
IfFileExists $WINDIR\Microsoft.NET\Framework64\v2.0.50727\regasm.exe Found1 NoFound1
NoFound1:
;---exit file is Installed
MessageBox MB_OK "Can't Install The File: regasm.exe does not existing!"
Quit
Found:
Found1:

SectiOnEnd

!include "MUI.nsh"
;--------------------------------
;Configuration

;General
OutFile "${INST_FILE}"

;Folder selection page
InstallDir "${INST_DEF_DIR}"

;Remember install folder
InstallDirRegKey HKCU "Software\${PRODUCT}" ""

;--------------------------------
;Modern UI Configuration
;Pages
;!define MUI_FINISHPAGE_NOAUTOCLOSE ;comment out if you want to jump to the finish page
!insertmacro MUI_PAGE_WELCOME
!ifdef LIC_FILE
!insertmacro MUI_PAGE_LICENSE "${LIC_FILE}"
!endif
!insertmacro MUI_PAGE_DIRECTORY
; !insertmacro MUI_PAGE_COMPONENTS ;if you have components to select
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro WordReplace

;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings

;Descriptions used in the Component selection dialog if used
;LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the ${INST_FILE} file to the application folder."

;--------------------------------
;Data
!ifdef LIC_FILE
LicenseData "${LIC_FILE}"
!endif

;--------------------------------
;Installer Sections

Section "InstallAddin" SecCopyUI

;ADD YOUR OWN STUFF HERE!

SetOutPath "$INSTDIR"
File "${ADDIN_DLL}"
File "${File1}"

!ifdef VIEW_DOC
File /nonfatal "${VIEW_DOC}"
!endif
;Store install folder
WriteRegStr HKCU "Software\${PRODUCT}" "" $INSTDIR

;Create uninstaller
WriteUninstaller "$INSTDIR\${UNINST_EXE}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${ADDIN_NAME}" "DisplayName" "${PRODUCT}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${ADDIN_NAME}" "UninstallString" "$INSTDIR\${UNINST_EXE}"
SectionEnd

;----------------------
Section "Registry" SetReg
IfFileExists $WINDIR\Microsoft.NET\Framework\v2.0.50727\regasm.exe Found11 NoFound11
Found11:
execwait '$WINDIR\Microsoft.NET\Framework\v2.0.50727\regasm.exe /codebase "$INSTDIR\${ADDIN_DLL1}"'
NoFound11:
IfFileExists $WINDIR\Microsoft.NET\Framework64\v2.0.50727\regasm.exe Found12 NoFound12
Found12:
execwait '$WINDIR\Microsoft.NET\Framework64\v2.0.50727\regasm.exe /codebase "$INSTDIR\${ADDIN_DLL1}"'
NoFound12:
SectionEnd

;----------------------
Section "View Help" ViewHelp
!ifdef VIEW_DOC
MessageBox MB_YESNO|MB_ICONQUESTION "Would you like View the Documentation?" IDNO NoDoc
ExecShell "open" "$INSTDIR\${VIEW_DOC}"
NoDoc:
!endif
SectiOnEnd
;----------------------

;Descriptions used in components to install page (description Text Stings per Section
;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
; !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
;!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------

;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN STUFF HERE!
IfFileExists $WINDIR\Microsoft.NET\Framework\v2.0.50727\regasm.exe Found13 NoFound13
Found13:
execwait '$WINDIR\Microsoft.NET\Framework\v2.0.50727\regasm.exe /u "$INSTDIR\${ADDIN_DLL1}"'
NoFound13:

IfFileExists $WINDIR\Microsoft.NET\Framework64\v2.0.50727\regasm.exe Found14 NoFound14
Found14:
execwait '$WINDIR\Microsoft.NET\Framework64\v2.0.50727\regasm.exe /u "$INSTDIR\${ADDIN_DLL1}"'
NoFound14:

Sleep 1000
Delete "$INSTDIR\${ADDIN_DLL1}"
Delete "$INSTDIR\${File_1}"
Delete "$INSTDIR\${UNINST_EXE}"

!ifdef VIEW_DOC
Delete "$INSTDIR\${VIEW_DOC}"
!endif
RMDir "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\${PRODUCT}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${ADDIN_NAME}"

SectionEnd

0 Likes