Hello all! I am excited to use LimeLM to license our software!
I have followed the tutorial step for step, when I compile my script I receive no errors. The script, and products files are all on my desktop. Including the .DAT and X86 DLL file for NSIS.
Even when using the example script, When I replace the GUID with the product I've added, I receive the same error. What is causing this and how would I fix this?
Here is my script:
;-------------------------------------------------------------------------------
; Includes
Unicode True
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
!include nsDialogs.nsh
!include WinVer.nsh
!include MUI.nsh
!define VersionGUID 'asrwo4tdc3kgqhjpqk26pf76v2yxdea'
!define REQUIRE_PKEY
!define REQUIRE_ACT
ReserveFile "TurboActivate.dll"
ReserveFile "TurboActivate.dat"
;-------------------------------------------------------------------------------
; Constants
!define PRODUCT_NAME "Project Coastline Tuscany"
!define PRODUCT_DESCRIPTION "Project Coastline Tuscany"
!define COPYRIGHT "Copyright © 2021 Project Coastline"
!define PRODUCT_VERSION "0.0.1.0"
!define SETUP_VERSION 1.0.0.0
;-------------------------------------------------------------------------------
; Attributes
Name "Project Coastline Tuscany"
OutFile "FSO_Tuscany.exe"
InstallDir "$APPDATA\Microsoft Flight Simulator\Packages\Community"
InstallDirRegKey HKCU "Software\FSOutlet\Project Coastline Tuscany" ""
RequestExecutionLevel user ; user|highest|admin
;-------------------------------------------------------------------------------
; Version Info
VIProductVersion "${PRODUCT_VERSION}"
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "FileDescription" "${PRODUCT_DESCRIPTION}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileVersion" "${SETUP_VERSION}"
;-------------------------------------------------------------------------------
; Modern UI Appearance
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\FSO.bmp"
!define MUI_FINISHPAGE_NOAUTOCLOSE
;-------------------------------------------------------------------------------
; Installer Pages
!define MUI_WELCOMEPAGE_TEXT "Thank you for your purchase of Project Coastline Tuscany. Please make sure that your Flight Simulator is closed before installing."
!define MUI_WELCOMEPAGE_TITLE "Welcome to the Project Coastline Tuscany installer."
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
Page custom PagePKey PagePKeyLeave
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Select your Community Folder for Microsoft Flight Simulator, View Installation Guide"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Function .onInit
; TurboActivate requires at least Windows XP
${IfNot} ${AtLeastWinXP}
MessageBox MB_OK "Windows XP (or newer) is required to run $(^NameDA)."
Quit
${EndIf}
; create the plugins folder
InitPluginsDir
; extract the TurboActivate files to the plugns folder
File /oname=$PLUGINSDIR\TurboActivate.dll "TurboActivate.dll"
File /oname=$PLUGINSDIR\TurboActivate.dat "TurboActivate.dat"
FunctionEnd
;--------------------------------
; Product key page
Var txtPKey
Function PagePKey
; TurboActivate is in the plugins directory.
; Setting the output path ensures we can call it.
SetOutPath $PLUGINSDIR
; Check if we're activated
System::Call "TurboActivate::IsActivated(w'${VersionGUID}') i.r2 ? c"
; Skip this page if we're already activated
${If} $2 == 0
Abort
${EndIf}
!insertmacro MUI_HEADER_TEXT "Type your product key" ""
nsDialogs::Create 1018
Pop $0
nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 30 "You can find the $(^NameDA) product key in the email we sent you. Activation will register the product key to this computer."
Pop $0
nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 50 100% 20 "Product Key:"
Pop $0
nsDialogs::CreateControl EDIT ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${ES_AUTOHSCROLL}|${WS_TABSTOP} ${WS_EX_CLIENTEDGE} 0 75 100% 12u ""
Pop $txtPKey
; focus the product key box
SendMessage $HWNDPARENT ${WM_NEXTDLGCTL} $txtPKey 1
nsDialogs::Show
FunctionEnd
Function PagePKeyLeave
; TurboActivate is in the plugins directory.
; Setting the output path ensures we can call it.
SetOutPath $PLUGINSDIR
; get the product key in WCHAR * form, put on $0
System::Call user32::GetWindowTextW(i$txtPKey,w.r0,i${NSIS_MAX_STRLEN})
; check if the product key is valid
System::Call "TurboActivate::CheckAndSavePKey(wr0, i1) i.r2 ? c"
; require the product key if we're requiring the activation
!ifdef REQUIRE_ACT
!ifndef REQUIRE_PKEY
!define REQUIRE_PKEY
!endif
!endif
${If} $2 == 0
; try to activate, show a specific error if it fails
System::Call "TurboActivate::Activate() i.r2 ? c"
!ifdef REQUIRE_ACT
${Switch} $2
${Case} 0 ; successful
Goto actSuccess
${Case} 2 ; TA_E_PKEY
MessageBox MB_OK|MB_ICONSTOP "The product key is invalid or there's no product key."
${Break}
${Case} 4 ; TA_E_INET
MessageBox MB_OK|MB_ICONSTOP "Connection to the server failed."
${Break}
${Case} 5 ; TA_E_INUSE
MessageBox MB_OK|MB_ICONSTOP "The product key has already been activated with the maximum number of computers."
${Break}
${Case} 6 ; TA_E_REVOKED
MessageBox MB_OK|MB_ICONSTOP "The product key has been revoked."
${Break}
${Case} 8 ; TA_E_PDETS
MessageBox MB_OK|MB_ICONSTOP "The product details file 'TurboActivate.dat' failed to load. It's either missing or corrupt."
${Break}
${Case} 11 ; TA_E_COM
MessageBox MB_OK|MB_ICONSTOP "CoInitializeEx failed."
${Break}
${Case} 13 ; TA_E_EXPIRED
MessageBox MB_OK|MB_ICONSTOP "Failed because your system date and time settings are incorrect. Fix your date and time settings, restart your computer, and try to activate again."
${Break}
${Case} 17 ; TA_E_IN_VM
MessageBox MB_OK|MB_ICONSTOP "Failed to activate because this instance of your program if running inside a virtual machine or hypervisor."
${Break}
${Case} 20 ; TA_E_KEY_FOR_TURBOFLOAT
MessageBox MB_OK|MB_ICONSTOP "The product key used is for TurboFloat, not TurboActivate."
${Break}
${Default}
MessageBox MB_OK|MB_ICONSTOP "Failed to activate."
${Break}
${EndSwitch}
!endif
${Else}
!ifdef REQUIRE_PKEY
MessageBox MB_OK|MB_ICONSTOP "You must enter a valid product key."
; focus the product key box
SendMessage $HWNDPARENT ${WM_NEXTDLGCTL} $txtPKey 1
Abort
!endif
${EndIf}
actSuccess:
FunctionEnd
;-------------------------------------------------------------------------------
; Cleanup Install Files
Function Cleanup
Delete ...
FunctionEnd
Function .onInstSuccess
Call Cleanup
FunctionEnd
Function .onInstFailed
Call Cleanup
FunctionEnd
;-------------------------------------------------------------------------------
; Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
;-------------------------------------------------------------------------------
; Installer Sections
Section "Dummy Section" SecDummy
SetOutPath "$INSTDIR"
File "TurboActivate.dll"
File "TurboActivate.dat"
File /r "C:\Users\joker\Desktop\projectcoastline-Tuscany_south*"
File /r "C:\Users\joker\Desktop\projectcoastline-Tuscany_north*"
File /r "C:\Users\joker\Desktop\projectcoastline-Tuscany_islands*"
;Store installation folder
WriteRegStr HKCU "Software\YourApp" "" $INSTDIR
SectionEnd