Problem to install on VISTA
Hi,
I am having an issue under VISTA. I post the complete skript I am using. It works well when being Admin, but it fails when a normal user runs the setup.exe under Vista.
The setup-process seems to work normaly but no files will be copied to disk, not start-menu-links are created ... It seems that there will be nothing changed on the users vista-box.
Can someone help please?
Thanks a lot!
!define PRODUCT_NAME "IAS"
!define PRODUCT_VERSION "2008"
!define PRODUCT_PUBLISHER "VDA Verband der Automobilindustrie e.V."
!define PRODUCT_WEB_SITE "http://www.vda.de"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "LogicLib.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "ReadMe\vda.ico"
!define MUI_UNICON "ReadMe\vda.ico"
; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
var FSup_ReadMeFile
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "VDA\2008\International Auto Statistics"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Start ${PRODUCT_NAME} ${PRODUCT_VERSION}"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!define MUI_FINISHPAGE_SHOWREADME "$FSup_ReadMeFile"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup_VDA-IAS2008.exe"
InstallDir "$PROGRAMFILES\VDA\2008\International Auto Statistics"
ShowInstDetails show
ShowUnInstDetails show
Function .onInit
SetOutPath $TEMP
File /oname=Setup.bmp "Setup.bmp"
advsplash::show 1500 600 400 -1 $TEMP\Setup
Pop $0
Delete $TEMP\Setup.bmp
!insertmacro MUI_LANGDLL_DISPLAY
${If} $LANGUAGE == ${LANG_GERMAN}
StrCpy $FSup_ReadMeFile "$INSTDIR\Info\LIESMICH.txt"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
StrCpy $FSup_ReadMeFile "$INSTDIR\Info\Readme.txt"
${EndIf}
FunctionEnd
Function LaunchLink
ExecShell "" "$INSTDIR\XLS\start.xls"
FunctionEnd
Section "Hauptgruppe" SEC01
SetOutPath "$INSTDIR\XLS"
SetOverwrite ifnewer
File "XLS\*.xls"
SetOutPath "$INSTDIR\PDF"
File "PDF\*.pdf"
SetOutPath "$INSTDIR\Info"
${If} $LANGUAGE == ${LANG_GERMAN}
File "ReadMe\LIESMICH.*"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
File "ReadMe\Readme.*"
${EndIf}
; Shortcuts
SetShellVarContext all
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\International Auto Statistics.lnk" "$INSTDIR\XLS\start.xls"
CreateShortCut "$DESKTOP\IAS 2008.lnk" "$INSTDIR\XLS\start.xls"
${If} $LANGUAGE == ${LANG_GERMAN}
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\LiesMich.txt.lnk" "$INSTDIR\Info\LIESMICH.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\LiesMich.doc.lnk" "$INSTDIR\Info\LIESMICH.doc"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReadMe.txt.lnk" "$INSTDIR\Info\Readme.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReadMe.doc.lnk" "$INSTDIR\Info\Readme.doc"
${EndIf}
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -AdditionalIcons
SetOutPath $INSTDIR
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\VDA Webseite.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
; CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) wurde erfolgreich deinstalliert."
FunctionEnd
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie $(^Name) und alle seinen Komponenten deinstallieren?" IDYES +2
Abort
FunctionEnd
Section Uninstall
SetShellVarContext all
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\Info\*.txt"
Delete "$INSTDIR\Info\*.doc"
Delete "$INSTDIR\PDF\*.pdf"
Delete "$INSTDIR\XLS\*.xls"
;Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
;Delete "$SMPROGRAMS\$ICONS_GROUP\VDA Website.lnk"
;Delete "$SMPROGRAMS\$ICONS_GROUP\LiesMich.lnk"
;Delete "$SMPROGRAMS\$ICONS_GROUP\ReadMe.lnk"
;Delete "$SMPROGRAMS\$ICONS_GROUP\ReadMe.lnk"
;Delete "$SMPROGRAMS\$ICONS_GROUP\LiesMich.lnk"
; MessageBox MB_OK "SMPROGRAMS: $SMPROGRAMS, ICONS_GROUP: $ICONS_GROUP" ;FSup20080904 Debug only :)
Delete "$SMPROGRAMS\$ICONS_GROUP\*.lnk"
Delete "$ICONS_GROUP.lnk"
Delete "$DESKTOP\IAS 2008.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\XLS"
RMDir "$INSTDIR\PDF"
RMDir "$INSTDIR\Info"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd