Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно
MKN MKN вне форума

Ветеран


Сообщения: 2355
Благодарности: 557

Профиль | Отправить PM | Цитировать


Цитата inco1:
чтобы в самом начале запуска установщика была проверка учетной записи »
Так это стандартные возможности "боксового" NSIS... В доке есть и пример :
Код: Выделить весь код
Name "UserInfo.dll test"
OutFile UserInfo.exe
RequestExecutionLevel Highest

!define REALMSG "$\nOriginal non-restricted account type: $2"

Function .onInit
	ClearErrors
	UserInfo::GetName
	IfErrors PluginFail
	Pop $0
	StrCmp $0 "" 0 +2
		StrCpy $0 "?"
	UserInfo::GetAccountType
	Pop $1
	UserInfo::GetOriginalAccountType
	Pop $2
	StrCmp $1 "Admin" 0 +3 
		MessageBox MB_OK 'User "$0" is in the Administrators group${REALMSG}'
		Goto done
	StrCmp $1 "Power" 0 +3
		MessageBox MB_OK 'User "$0" is in the Power Users group${REALMSG}'
		Goto done
	StrCmp $1 "User" 0 +3
		MessageBox MB_OK 'User "$0" is just a regular user${REALMSG}'
		Goto done
	StrCmp $1 "Guest" 0 +3
		MessageBox MB_OK 'User "$0" is a guest${REALMSG}'
		Goto done
	MessageBox MB_OK "Unknown error"
	Goto done

	PluginFail:
		MessageBox MB_OK "Error! Unable to call plug-in!"
	done:
FunctionEnd

Section
SectionEnd
Можно конечно и по всякому...
Это сообщение посчитали полезным следующие участники:

Отправлено: 18:03, 04-06-2020 | #2431