|
|
#1 |
|
Member
Join Date: Oct 2004
Posts: 68
|
Writing to the registry fails
I am using/testing the script below, so far I cant get it to write data to the uninstall section of the Windows registry. It should show me XXX I believe but nothing gets added to that section of the registry.
My account has admin rights..... Script->>>>>> ;Setup program ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ;General ;Name and file Name "XXX YYY" OutFile "Setup.exe" ;Default installation folder InstallDir "$EXEDIR" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\XXX\YYY\Uninstall" "" BrandingText /TRIMLEFT "XXXYYY Setup" XPStyle on ;-------------------------------- ;Interface Configuration !define MUI_ICON setup.ico !define MUI_UNICON setup.ico !define MUI_ABORTWARNING !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP header.bmp !define MUI_WELCOMEFINISHPAGE_BITMAP welcome.bmp XPStyle on ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE license.txt !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections Section "Standard installation" StandardInstall SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... ;Store installation folder WriteRegStr HKCU "Software\XXX\YYY" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\" "XXX" "YYY" SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_StandardInstall ${LANG_ENGLISH} "Standard installation." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${StandardInstall} $(DESC_StandardInstall) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\Uninstall.exe" RMDir "$INSTDIR" DeleteRegKey /ifempty HKCU "Software\XXX" DeleteRegKey /ifempty HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\XXX" SectionEnd ;-------------------------------- ;Init Section Function .onInit SetOutPath $TEMP File /oname=spltmp.bmp "splash.bmp" ; optional ; File /oname=spltmp.wav "splash.wav" splash::show 1000 $TEMP\spltmp Pop $0 ; $0 has '1' if the user closed the splash screen early, ; '0' if everything closed normal, and '-1' if some error occured. Delete $TEMP\spltmp.bmp ; Delete $TEMP\spltmp.wav FunctionEnd |
|
|
|
|
|
#2 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,898
|
here:
code: Where is allocated the returning var??? That's why: code: If I remember.
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
|
|
#3 | |
|
Member
Join Date: Oct 2004
Posts: 68
|
Quote:
I found the method on the NSIS archive and it didn't mention using a var, oh well. Thanks. |
|
|
|
|
|
|
#4 | |
|
Member
Join Date: Oct 2004
Posts: 68
|
Quote:
The problem is this line below, it doesn't yield a new data entry within the registry: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\" "XXX" "YYY" |
|
|
|
|
|
|
#5 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,898
|
Of course is only for example propuse
![]() You do the real stuff
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|