Skip to content

CPack/NSIS: Fix incorrect jump for standard user

Sprite requested to merge SpriteOvO/cmake:nsis-correct-jump into master

Revert an incorrect change from commit c4a0bcea.

Original Description

I encountered a bug that was reported ten years ago, but it was forgotten in the old issue tracker, so I opened this MR to fix it.

Original report:

====================================================================== 
http://www.cmake.org/Bug/view.php?id=13939 
====================================================================== 
Reported By:                Urs Fleisch
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13939
Category:                   CPack
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-02-21 03:55 EST
Last Modified:              2013-02-21 03:55 EST
====================================================================== 
Summary:                    NSIS installer doesn't honor standard user
permission
Description: 
When installing an NSIS package generated by CMake as a standard user, the
installer tries to install the program into the "all users" location, which
fails because of permissions. It should install into the user's directory.

The bug seems to have been introduced while fixing
http://www.cmake.org/Bug/view.php?id=12923 (commit
c4a0bcea775981dea86d527f66161c98f5e05e95). Whereas the first correction from +3
to +4 was correct to enable the recognition of power users, the second change

-  StrCmp $1 "Power" 0 +3
+  StrCmp $1 "Power" 0 +4

is wrong. It will jump to "StrCpy $SV_ALLUSERS "AllUsers" instead of "Goto done"
for a standard user. This change should be reverted.

Steps to Reproduce: 
Use the NSIS generator, install as a standard user.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-02-21 03:55 Urs Fleisch    New Issue                                    
======================================================================

Fixes: #13939 (closed)

Edited by Brad King

Merge request reports