Archive: Installer only works on my machine.


Installer only works on my machine.
So, I was writing an installer for a custom Counter-Strike: Source GUI (very simple). The installer works fine on my machine, but doesn't work for anyone else... I mean no one. I can't understand what the problem is. The process shows up in the task-manager, and it's using a TON of resources, but the installer never shows on the desktop. Here's the code..

;Steam folder finder for dod source....
;It will detect the Vista install path and if not found move to XP... if no luck still will display a message of a manual install
;Next is the Steam folder finder Functions.
;Looking for Vista or XP install path... querying the registry now...
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\stall\Steam App 300" "InstallLocation"
InstallDirRegKey HKCU "Software\Valve\Steam" "ModInstallPath"

Function .onInit
;If Windows Vista is there, read this and go to ok next or not finding Vista go to WinXP next...
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 300" "InstallLocation"
IfErrors winXP ok
winXP:
;Vista seems not to be there. Will now read a XP registry key and go to ok or noXP next... manual install message...
ReadRegStr $R0 HKCU "Software\Valve\Steam" "ModInstallPath"
IfErrors noXP ok
noXP:
IfErrors notok ok
notok:
;notok means we may have a retail version or a screwed up registry, lets display a huge instruction message for the user to manually install...
MessageBox MB_YESNO|MB_ICONEXCLAMATION "INSTALLER HELP SCREEN: Installer can't automatically find the cstrike folder address. $\r$\rIT'S OK TO CONTINUE... it just means you will have to find it manually... $\r$\r1. Press Yes, then Next... $\r$\r2. Select your options from the Components screen. Press Next... $\r$\r3. Press Browse in the Choose Install Location screen and navigate to the cstrike folder...$\r$\rHere is a sample of a typical cstrike folder address...$\r$\rC:\Program Files\Steam\steamapps\YOUR_EMAIL_ADDRESS\counter-strike source\cstrike $\r$\rRemember... the last folder must be the cstrike folder! See the readme for this same info. $\r$\r4. Press Install ... then Finish in the popup after that. DONE!" IDYES done
Abort
ok:
Loop:
StrLen $R1 $R0
StrCpy $R2 $R0 $R1 -1
StrCpy $R0 $R0 -1
StrCmp "\" $R2 fin loop
fin:
StrCpy $INSTDIR $R0
StrCpy $INSTDIR "$INSTDIR\counter-strike source\cstrike" ;Change this for other mods like... \counter-strike source\cstrike
done:
FunctionEnd
;END of the Steam folder finder Function
; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "n00bfest.com GUI"
!define PRODUCT_VERSION "1.4"
!define PRODUCT_PUBLISHER "acid_rain"
!define PRODUCT_WEB_SITE "http://www.n00bfest.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "n00bfest.com GUI v1.4.exe"
InstallDir "$INSTDIR"
ShowInstDetails show
ShowUnInstDetails show

Section "n00bfest.com GUI 1.4" SEC01
SetOutPath "$INSTDIR\materials\console"
SetOverwrite try
File "materials\console\background01.vtf"
File "materials\console\background01_widescreen.vtf"
SetOutPath "$INSTDIR"
File "n00bfest GUI README.txt"
File "n00bfest.com GUI CHANGELOG.txt"
SetOutPath "$INSTDIR\resource"
File "resource\ClientScheme.res"
File "resource\GameMenu.res"
File "resource\gameui_english.txt"
SetOutPath "$INSTDIR\resource\ui"
File "resource\ui\BaseChat.res"
File "resource\ui\ScoreBoard.res"
File "resource\ui\Teammenu.res"
SetOutPath "$INSTDIR\scripts"
File "scripts\hudanimations.txt"
File "scripts\HudLayout.res"
File "scripts\kb_act.lst"
File "scripts\titles.txt"
SectionEnd

Section -AdditionalIcons
SetOutPath $INSTDIR
CreateDirectory "$SMPROGRAMS\n00bfest.com GUI"
CreateShortCut "$SMPROGRAMS\n00bfest.com GUI\Uninstall.lnk" "$INSTDIR\uninst n00bfest GUI.exe"
SectionEnd

Section -Post
WriteUninstaller "$INSTDIR\uninst n00bfest GUI.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst n00bfest GUI.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) was successfully removed from your computer."
FunctionEnd

Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd

Section Uninstall
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\scripts\titles.txt"
Delete "$INSTDIR\scripts\kb_act.lst"
Delete "$INSTDIR\scripts\HudLayout.res"
Delete "$INSTDIR\scripts\hudanimations.txt"
Delete "$INSTDIR\resource\ui\Teammenu.res"
Delete "$INSTDIR\resource\ui\ScoreBoard.res"
Delete "$INSTDIR\resource\ui\BaseChat.res"
Delete "$INSTDIR\resource\gameui_english.txt"
Delete "$INSTDIR\resource\GameMenu.res"
Delete "$INSTDIR\resource\ClientScheme.res"
Delete "$INSTDIR\n00bfest.com GUI CHANGELOG.txt"
Delete "$INSTDIR\n00bfest GUI README.txt"
Delete "$INSTDIR\materials\console\background01_widescreen.vtf"
Delete "$INSTDIR\materials\console\background01.vtf"

Delete "$SMPROGRAMS\n00bfest.com GUI\Uninstall.lnk"

RMDir "$SMPROGRAMS\n00bfest.com GUI"
RMDir "$INSTDIR\scripts"
RMDir "$INSTDIR\resource\ui"
RMDir "$INSTDIR\resource"
RMDir "$INSTDIR\materials\console"
RMDir "$INSTDIR"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd


Please do not paste huge amounts of code like that. Use pastebin, or an attachment.

Also, if your installer hangs, it's likely that it's stuck in a loop. And since you have a loop right there in .onInit...


There is problem in your LOOP code:
I put MessageBox right afther the Loop: label and I have nothing in $R1 and $R0 - it is a empty string(s)


Loop:
MessageBox MB_OK "$R1 $R0"

So Modify the code before this Loop: label

Btw you have InstallDirRegKey specified multiple times - thats wasting a space