aboutsummaryrefslogtreecommitdiffstats
path: root/Installer/settings/functions.nsh
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
commit51ed8fe6f2ea9892e905e81cf5bad3960537eb40 (patch)
treea4dcb099343762dcb7bd7988f73de68c1959d3a5 /Installer/settings/functions.nsh
downloadusdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.gz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.xz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.zip
Challenge MOD r7 alpha based on Ultrastar Deluxe v1.0.1a
for changes read Changelog.txt in folder Game git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2107 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Installer/settings/functions.nsh')
-rw-r--r--Installer/settings/functions.nsh78
1 files changed, 78 insertions, 0 deletions
diff --git a/Installer/settings/functions.nsh b/Installer/settings/functions.nsh
new file mode 100644
index 00000000..147ec76c
--- /dev/null
+++ b/Installer/settings/functions.nsh
@@ -0,0 +1,78 @@
+!define exe2 "USdx" ; Current name of start exe
+; Creates Desktop Shortcut(s) if
+; checked on Finish Page
+
+Function CreateDesktopShortCuts
+
+SetOutPath "$INSTDIR"
+
+CreateShortcut "$Desktop\$(sm_shortcut).lnk" "$INSTDIR\${exe2}.exe"
+
+FunctionEnd
+
+; Deletes only empty dirs which are
+; at the top of the stack.
+
+Function un.DeleteIfEmpty
+ FindFirst $R0 $R1 "$0\*.*"
+ strcmp $R1 "." 0 NoDelete
+ FindNext $R0 $R1
+ strcmp $R1 ".." 0 NoDelete
+ ClearErrors
+ FindNext $R0 $R1
+ IfErrors 0 NoDelete
+ FindClose $R0
+ Sleep 1000
+ RMDir "$0"
+ NoDelete:
+ FindClose $R0
+FunctionEnd
+
+; This is used to write a
+; string to config.ini
+
+Function WriteToConfig
+ Exch $0
+ Exch
+ Exch $1
+
+ FileOpen $0 $0 a
+ FileSeek $0 0 END
+ FileWrite $0 $1
+ FileClose $0
+
+ Pop $1
+ Pop $0
+FunctionEnd
+
+!macro WriteToConfig String File
+ Push "${String}"
+ Push "${File}"
+ Call WriteToConfig
+!macroend
+!define WriteToConfig "!insertmacro WriteToConfig"
+
+; Finds UltraStar Deluxe process
+;
+
+!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`
+
+!macro nsProcess::FindProcess _FILE _ERR
+ nsProcess::_FindProcess /NOUNLOAD `${_FILE}`
+ Pop ${_ERR}
+!macroend
+
+
+!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`
+
+!macro nsProcess::KillProcess _FILE _ERR
+ nsProcess::_KillProcess /NOUNLOAD `${_FILE}`
+ Pop ${_ERR}
+!macroend
+
+
+!define nsProcess::Unload `!insertmacro nsProcess::Unload`
+
+!macro nsProcess::Unload
+ nsProcess::_Unload
+!macroend \ No newline at end of file