Merge pull request #314 from ctrlaltca/win32_setup_fix
Fix oracle under windows
This commit is contained in:
commit
48817ed283
2 changed files with 22 additions and 13 deletions
|
@ -51,13 +51,15 @@ Section "Application" SecApplication
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Update configuration" SecUpdateConfig
|
Section "Update configuration" SecUpdateConfig
|
||||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$APPDATA\Cockatrice\cards.xml"
|
SetShellVarContext current
|
||||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$APPDATA\Cockatrice\decks"
|
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$LOCALAPPDATA\Cockatrice\cards.xml"
|
||||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$APPDATA\Cockatrice\pics"
|
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$LOCALAPPDATA\Cockatrice\decks"
|
||||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$APPDATA\Cockatrice\sounds"
|
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$LOCALAPPDATA\Cockatrice\pics"
|
||||||
|
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$LOCALAPPDATA\Cockatrice\sounds"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Start menu item" SecStartMenu
|
Section "Start menu item" SecStartMenu
|
||||||
|
SetShellVarContext all
|
||||||
createDirectory "$SMPROGRAMS\Cockatrice"
|
createDirectory "$SMPROGRAMS\Cockatrice"
|
||||||
createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe" '--debug-output'
|
createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe" '--debug-output'
|
||||||
createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe"
|
createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe"
|
||||||
|
@ -65,7 +67,7 @@ Section "Start menu item" SecStartMenu
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
RMDir /r "$INSTDIR\zonebg"
|
RMDir /r "$INSTDIR\zonebg"
|
||||||
RMDir /r "$INSTDIR\plugins"
|
RMDir /r "$INSTDIR\plugins"
|
||||||
RMDir /r "$INSTDIR\sounds"
|
RMDir /r "$INSTDIR\sounds"
|
||||||
|
@ -83,8 +85,10 @@ SetShellVarContext all
|
||||||
|
|
||||||
RMDir "$SMPROGRAMS\Cockatrice"
|
RMDir "$SMPROGRAMS\Cockatrice"
|
||||||
|
|
||||||
DeleteRegKey HKCU "Software\Cockatrice"
|
|
||||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
|
||||||
|
|
||||||
|
SetShellVarContext current
|
||||||
|
DeleteRegKey HKCU "Software\Cockatrice"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files"
|
LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files"
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
#include <QDir>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
@ -403,15 +404,13 @@ bool SaveSetsPage::validatePage()
|
||||||
QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
|
QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
|
||||||
#endif
|
#endif
|
||||||
QSettings* settings = new QSettings(this);
|
QSettings* settings = new QSettings(this);
|
||||||
QString savePath = settings->value("paths/carddatabase").toString();
|
QString defaultPath = settings->value("paths/carddatabase").toString();
|
||||||
if (savePath.isEmpty()) {
|
|
||||||
QDir().mkpath(dataDir);
|
|
||||||
}
|
|
||||||
QString windowName = tr("Save card database");
|
QString windowName = tr("Save card database");
|
||||||
QString fileType = tr("XML; card database (*.xml)");
|
QString fileType = tr("XML; card database (*.xml)");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
QString fileName;
|
QString fileName;
|
||||||
if (savePath.isEmpty()) {
|
if (defaultPath.isEmpty()) {
|
||||||
if (defaultPathCheckBox->isChecked())
|
if (defaultPathCheckBox->isChecked())
|
||||||
fileName = dataDir + "/cards.xml";
|
fileName = dataDir + "/cards.xml";
|
||||||
else
|
else
|
||||||
|
@ -420,13 +419,19 @@ bool SaveSetsPage::validatePage()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (defaultPathCheckBox->isChecked())
|
if (defaultPathCheckBox->isChecked())
|
||||||
fileName = savePath;
|
fileName = defaultPath;
|
||||||
else
|
else
|
||||||
fileName = QFileDialog::getSaveFileName(this, windowName, savePath, fileType);
|
fileName = QFileDialog::getSaveFileName(this, windowName, defaultPath, fileType);
|
||||||
}
|
}
|
||||||
if (fileName.isEmpty()) {
|
if (fileName.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFileInfo fi(fileName);
|
||||||
|
QDir fileDir(fi.path());
|
||||||
|
if (!fileDir.exists() && !fileDir.mkpath(fileDir.absolutePath())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (wizard()->importer->saveToFile(fileName))
|
if (wizard()->importer->saveToFile(fileName))
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
|
|
Loading…
Reference in a new issue